From 260c35aed09fcde4c70a7747d0ba327926aeb5b7 Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Sun, 31 Dec 2023 21:49:13 -0600 Subject: [PATCH 001/226] Added permutations class, with tests and docs --- M2/Macaulay2/m2/permutations.m2 | 312 ++++ .../packages/Macaulay2Doc/doc_permutations.m2 | 1276 +++++++++++++++++ M2/Macaulay2/tests/normal/permutations.m2 | 227 +++ 3 files changed, 1815 insertions(+) create mode 100644 M2/Macaulay2/m2/permutations.m2 create mode 100644 M2/Macaulay2/packages/Macaulay2Doc/doc_permutations.m2 diff --git a/M2/Macaulay2/m2/permutations.m2 b/M2/Macaulay2/m2/permutations.m2 new file mode 100644 index 00000000000..c38589434a4 --- /dev/null +++ b/M2/Macaulay2/m2/permutations.m2 @@ -0,0 +1,312 @@ +-- Sean Grate + +----------------------------------------------------------------------------- +-- Local utilities +----------------------------------------------------------------------------- + +to1Index = w -> (w / (i -> i+1)) +to0Index = w -> (w / (i -> i-1)) + +----------------------------------------------------------------------------- +-- Permutation type declarations and basic constructors +----------------------------------------------------------------------------- + +Permutation = new Type of BasicList +Permutation.synonym = "permutation" + +isValidPermutation = method(TypicalValue => Boolean) +isValidPermutation List := Boolean => w -> (((sort w) == toList(1..#w)) and not (#w == 0)) + +new Permutation from BasicList := (typeofPermutation,w) -> ( + if not isValidPermutation(w) then error(toString w | " is not a valid permutation in one-line notation."); + w +) + +permutation = method(TypicalValue => Permutation) +permutation List := Permutation => w -> new Permutation from w + +----------------------------------------------------------------------------- +-- Permutation string representations +----------------------------------------------------------------------------- +expression Permutation := w -> expression toList w +toString Permutation := w -> toString expression toList w +tex Permutation := w -> tex expression toSequence w +html Permutation := w -> html expression toList w + +----------------------------------------------------------------------------- +-- Indexing permutations as lists +----------------------------------------------------------------------------- +Permutation _ ZZ := List => (w,n) -> ((toList w)_(n-1)) +Permutation _ List := List => (w,l) -> ((toList w)_l) +Permutation _ Sequence := List => (w,s) -> ((toList w)_(toList s)) + +----------------------------------------------------------------------------- +-- Change which symmetric group S_n to view a permutation as an element of +----------------------------------------------------------------------------- +-- it would be nice if this method was called "trim", but that is a protected global variable +reduce = method(TypicalValue => Permutation) +reduce Permutation := Permutation => w -> ( + w = w_(select(#w, i -> w_{i ..< #w} != toList(i+1 .. #w))); + if #w == 0 then permutation {1} else permutation w +) + +-- it would be nice if this method was called "extend", but that is a protected global variable +expand = method(TypicalValue => Permutation) +expand (Permutation, ZZ) := Permutation => (w,n) -> ( + if n < #w then error(toString w | " is a permutation on more than " | toString n | " letters."); + permutation(toList(w) | toList(#w+1..n)) +) +expand (Permutation, Permutation) := (Permutation, Permutation) => (w,v) -> ( + n := max(#w, #v); + (expand(w,n), expand(v,n)) +) + +----------------------------------------------------------------------------- +-- Basic permutation operations +----------------------------------------------------------------------------- +Permutation == Permutation := Boolean => (w, v) -> ( + (w, v) = expand(w,v); + toList(w) == toList(v) +) +Permutation * Permutation := Permutation => (w, v) -> ( + (w,v) = expand(w,v); + reduce permutation w_(to0Index toList v) +) +-- power implementation modified from Mahrud's in https://github.com/Macaulay2/M2/issues/2581 +Permutation ^ ZZ := Permutation => (w, n) -> fold(if n < 0 then (-n):(permutation to1Index inversePermutation to0Index toList w) else n:w, + permutation toList (1 .. #w), + (w, v) -> w*v) + +----------------------------------------------------------------------------- +-- Matrix representation of a permutation +----------------------------------------------------------------------------- +-- some people prefer the transpose of this +toMatrix = method(TypicalValue => Matrix) +toMatrix Permutation := Matrix => w -> ( + id_(ZZ^(#w))_(to0Index toList w) +) + +----------------------------------------------------------------------------- +-- Group actions +----------------------------------------------------------------------------- +Permutation * List := List => (w, l) -> ( + if #(reduce w) > #l then error(toString w | " permutes more than " | toString #l | " elements.") + else l_(to0Index toList expand(w, #l)) +) +-- group action on a matrix permutes the ROWS of the matrix +-- maybe would prefer to permute the columns? Seems more natural +Permutation * Matrix := List => (w, M) -> ( + m := numRows M; + if #(reduce w) > m then error(toString w | " permutes more than " | toString m | " elements.") + else (toMatrix expand(w, m)) * M +) + +----------------------------------------------------------------------------- +-- Cycle decomposition of a permutation +----------------------------------------------------------------------------- +-- every permutation can be written as a product of disjoint cycles (in cycle notation) +cycleDecomposition = method(TypicalValue => List) +cycleDecomposition Permutation := List => w -> ( + w = to0Index toList w; + cycles := {}; + unvisited := toList(0 ..< #w); + while #unvisited != 0 do ( + startIdx := unvisited#0; + visited := {startIdx}; + nextIdx := w#startIdx; + while nextIdx != startIdx do ( + visited = append(visited, nextIdx); + nextIdx = w#nextIdx; + ); + cycles = append(cycles, visited); + for idx in visited do unvisited = delete(idx, unvisited); + ); + cycles = cycles / to1Index / toSequence; + -- put decomposition into its standard or canonical representation (see https://en.wikipedia.org/wiki/Permutation#canonical_cycle_notation) + -- a permutation's cycle decomposition is "canonical" or "standard" if + -- 1. each cycle lists the largest element first and + -- 2. the cycles are sorted by their first element in increasing order + sortedCycles := for cycle in cycles list toSequence rotate(maxPosition cycle, toList cycle); + sort sortedCycles +) + +cycleType = method(TypicalValue => Sequence) +cycleType Permutation := Sequence => w -> ( + toSequence rsort for cycle in cycleDecomposition w list #cycle +) + +----------------------------------------------------------------------------- +-- Ascents, descents, runs, exceedances, and records +-- NOTE: All return the 1-indexed results for consistency with the permutation notation +----------------------------------------------------------------------------- +ascents = method(TypicalValue => List) +ascents Permutation := List => w -> ( + for i in 1 ..< #w list if w_i < w_(i+1) then i else continue +) + +descents = method(TypicalValue => List) +descents Permutation := List => w -> ( + for i in 1 ..< #w list if w_i > w_(i+1) then i else continue +) + +ascendingRuns = method(TypicalValue => List) +ascendingRuns Permutation := List => w -> ( + -- inspired from the SageMath implementation + -- https://github.com/sagemath/sage/blob/develop/src/sage/combinat/permutation.py + if #w == 1 then allRuns := {toSequence w} + else ( + allRuns = {}; + currentRun = {w#0}; + for wi in w_(toList(1 ..< #w)) do ( + if wi > last currentRun then currentRun = append(currentRun, wi) + else ( + allRuns = append(allRuns, toSequence currentRun); + currentRun = {wi}; + ); + ); + allRuns = append(allRuns, toSequence currentRun); + ); + allRuns +) + +descendingRuns = method(TypicalValue => List) +descendingRuns Permutation := List => w -> ( + -- inspired from the SageMath implementation + -- https://github.com/sagemath/sage/blob/develop/src/sage/combinat/permutation.py + if #w == 1 then allRuns := {toSequence w} + else ( + allRuns = {}; + currentRun = {w#0}; + for wi in w_(toList(1 ..< #w)) do ( + if wi < last currentRun then currentRun = append(currentRun, wi) + else ( + allRuns = append(allRuns, toSequence currentRun); + currentRun = {wi}; + ); + ); + allRuns = append(allRuns, toSequence currentRun); + ); + allRuns +) + +exceedances = method(TypicalValue => List, + Options => {Weak => false}) +exceedances Permutation := List => opts -> w -> ( + compare := if opts.Weak then ((i,j) -> i <= j) else ((i,j) -> i < j); + for i in 1 .. #w list if compare(i,w_i) then i else continue +) + +saliances = method(TypicalValue => List) +saliances Permutation := List => w -> ( + to1Index positions(1 .. #w, i -> all(i+1 .. #w, j -> w_i > w_j)) +) + +records = method(TypicalValue => List) +records Permutation := List => w -> ( + to1Index positions(1 .. #w, i -> all(1 ..< i, j -> w_j < w_i)) +) + +----------------------------------------------------------------------------- +-- Pattern avoidance +----------------------------------------------------------------------------- +avoidsPattern = method(TypicalValue => Boolean) +avoidsPattern (Permutation,List) := Boolean => (w, pattern) -> ( + --assume permutation is pattern-avoiding, break if not true + isAvoiding := true; + for idx in subsets(0 ..< #w, #pattern) do ( + sortedIdx := sort(idx); + pairwiseComparison := apply(pattern_{0..#pattern-2}, pattern_{1..#pattern-1}, (i,j) -> w#(sortedIdx#(i-1)) < w#(sortedIdx#(j-1))); -- pairwise comparison of permutation according to pattern + isAvoiding = not all(pairwiseComparison, i -> i == true); -- true if there was one inequality that failed, else all inequalities are true and so not pattern-avoiding + if not isAvoiding then break; + ); + isAvoiding +) + +avoidsPatterns = method(TypicalValue => Boolean) +avoidsPatterns (Permutation, List) := Boolean => (w, patterns) -> ( + all(patterns, pattern -> avoidsPattern(w, pattern)) +) + +isVexillary = method(TypicalValue => Boolean) +isVexillary Permutation := Boolean => (w) -> ( + avoidsPattern(w, {2,1,4,3}) +) + +isCartwrightSturmfels = method(TypicalValue => Boolean) +isCartwrightSturmfels Permutation := Boolean => w -> ( + patterns := {{1,2,5,4,3}, + {1,3,2,5,4}, + {1,3,5,2,4}, + {1,3,5,4,2}, + {2,1,5,4,3}, + {1,2,5,3,6,4}, + {1,2,5,6,3,4}, + {2,1,5,3,6,4}, + {2,1,5,6,3,4}, + {3,1,5,2,6,4}, + {3,1,5,6,2,4}, + {3,1,5,6,4,2}}; + avoidsPatterns(w, patterns) +) + +isCDG = method(TypicalValue => Boolean) +isCDG Permutation := Boolean => w -> ( + patterns := {{1,3,2,5,4}, + {2,1,5,4,3}, + {2,1,4,6,3,5}, + {2,1,5,3,6,4}, + {2,1,5,6,3,4}, + {2,4,1,6,3,5}, + {3,1,5,2,6,4}, + {4,2,6,1,7,3,5}}; + avoidsPatterns(w, patterns) +) + +----------------------------------------------------------------------------- +-- Foata's fundamental bijection +----------------------------------------------------------------------------- +-- see https://en.wikipedia.org/wiki/Permutation#Foata's_transition_lemma +foataBijection = method(TypicalValue => Permutation) +foataBijection Permutation := Permutation => w -> ( + permutation splice cycleDecomposition w +) + +----------------------------------------------------------------------------- +-- Miscellaneous +----------------------------------------------------------------------------- +inverse Permutation := Permutation => w -> (permutation to1Index inversePermutation to0Index toList w) + +-- order of a permutation, i.e. smallest integer n such that w^n = identity +-- the order of a permutation can be expressed as the lcm of its cycle lengths +ord = method(TypicalValue => ZZ) +ord Permutation := ZZ => w -> ( + lcm((cycleDecomposition w) / length) +) + +-- see https://en.wikipedia.org/wiki/Parity_of_a_permutation for different ways +-- to compute the sign or parity of a permutation +sign = method(TypicalValue => ZZ) +sign Permutation := ZZ => w -> ( + if even(#w - #(cycleDecomposition w)) then 1 else -1 +) + +isEven = method(TypicalValue => Boolean) +isEven Permutation := Boolean => w -> ( + sign w == 1 +) + +isOdd = method(TypicalValue => Boolean) +isOdd Permutation := Boolean => w -> ( + sign w == -1 +) + +isDerangement = method(TypicalValue => Boolean) +isDerangement Permutation := Boolean => w -> (not any(cycleDecomposition w, cycle -> #cycle == 1)) + +fixedPoints = method(TypicalValue => List) +fixedPoints Permutation := Boolean => w -> (for cycle in cycleDecomposition w list if #cycle == 1 then unsequence cycle else continue) + +inversions = method(TypicalValue => List) +inversions Permutation := List => w -> ( + for idxPair in sort(subsets(toList w, 2) / sort) list if w_(idxPair#0 - 1) > w_(idxPair#1 - 1) then idxPair else continue +) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc_permutations.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc_permutations.m2 new file mode 100644 index 00000000000..6664e448ddf --- /dev/null +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc_permutations.m2 @@ -0,0 +1,1276 @@ +-- Sean Grate + +doc /// + Key + "permutations" + Headline + a detailed overview of permutations in Macaulay2 + Description + Text + This page gives an overview of the use of permutations. + + The sections of the overview are, in order: + + {\bf Creating permutations.} @BR{}@ + {\bf Indexing.} @BR{}@ + {\bf Basic operations.} @BR{}@ + {\bf Group actions.} @BR{}@ + {\bf Cyclic Decompositions.} @BR{}@ + {\bf Ascents, descents, runs, exceedances, and records.} @BR{}@ + {\bf Pattern avoidance.} @BR{}@ + {\bf Foata's fundamental bijection.} @BR{}@ + {\bf Miscellaneous.} + + Links to individual documentation pages for the functions + described in this article are collected in an alphabetized list + at the very end of the page. + + + {\bf Creating permutations.} + + Permutations are constructed from lists. To create a {\bf permutation}, + use the {\tt permutation} method: + Example + p = permutation {3,1,2,4,5} + Text + Permutations must be constructed from lists consisting of only the integers + $1 \textemdash n$. If a list contains any other elements or does not consist of the entire + range, then an error is thrown. + The method @TO toMatrix@ can be used to get the matrix representation of the + permutation. In this representation, for a permutation $p$, if $p(i)=j$, then + then the $(i,j)$th entry is $1$. + Example + p = permutation {3,1,2,4,5} + toMatrix p + Text + This is especially useful for considering the action of permutations on matrices, + see {\bf Group actions}. + + -- + Text + + {\bf Basic operations.} + + Two permutations $p$ and $q$ are equal if they are equal as functions, i.e., + if $p(i) = q(i)$ for all $i$. + Example + p = permutation {3,1,2} + q = permutation {3,1,2,4,5} + p == q + Text + We can also multiply (or compose) two permutations. We follow the convention + of $(p*q)(i) = p(q(i))$. + Example + p = permutation {3,1,2,5,4} + q = permutation {2,1,3,4,5} + p*q + Text + This also let's us compute powers of permutations. + Example + p = permutation {3,1,2,5,4} + p^2 + p^6 + p^0 + p^(-1) + p^(-2) + + -- + Text + + {\bf Group actions.} + + A permutation on $n$ symbols acts on lists of size $n$ by permuting its contents + according to the permutation. + Example + p = permutation {3,1,2,5,4}; + L = {1,2,3,4,5}; + p*L + Text + A permutation $p$ on $n$ symbols can also be regarded as a permutation on $N$ + symbols for any $N \geq n$ by regarding all of the indices $n+1, n+2, \hdots$ + as fixed by $p$, i.e., $p(i)=i$ for all $i > n$. This is also reflected in the + group action. + Example + p = permutation {3,1,2,5,4}; + L = {1,2,3,4,5,6,7,8}; + p*L + Text + In a similar manner, permutations on $n$ symbols also act on the space of + $n \times n$ matrices by permuting the rows (or columns). For us, this group + action is reflected via permutation of the rows of the matrix. Another way to + view this action is via the multiplication on the left by the matrix representation + of the permutation. + Example + p = permutation {3,1,2}; + M = id_(ZZ^3); + p*M + Text + Just as in the case of lists, the size of the matrix can be larger than $n$. + Example + p = permutation {3,1,2}; + M = id_(ZZ^5); + p*M + Text + The matrix does not need to be square. As long as the number of rows is + greater than or equal largest non-fixed point of the permutation, the action + is valid. + Example + p = permutation {3,1,2}; + M = id_(ZZ^3) || id_(ZZ^3); + N = matrix {{1,0},{0,1},{1,1}}; + p*M + p*N + + -- + Text + + {\bf Cycle decompositions.} + + Every permutation can be decomposed as a product of disjoint cycles. + This can be computed with {\tt cycleDecomposition}. + Example + p = permutation {3,1,2,5,4} + cycleDecomposition p + Text + We follow the convention to write the decomposition in its "canonical" or + "standard" form. So + + 1. each cycle is listed with its largest element first, and @BR{}@ + 2. the cycles are listed in increasing order. + + A permutation's \emph{cycle type} is the sequence consisting of the lengths of the + cycles in its cycle decomposition, listed in weakly decreasing order. + Example + cycleType p + + -- + Text + + {\bf Ascents, descents, runs, exceedances, saliances, and records.} + + A permutation $p=(p_1 \, \hdots \, p_n)$ has an \emph{ascent} at $i$ (for $i < n$) + if $p(i) < p(i+1)$. Similarly, it has a \emph{descent} at $i$ (for $i < n$) if + $p(i) > p(i+1)$. We can compute the set of ascents and the set of descents using + {\tt ascents} and {\tt descents}, respectively. + Example + p = {3,1,2,5,4}; + ascents p + descents p + Text + An \emph{ascending run} is a maximal subsequence of successive ascents. + Similarly, a \emph{descending run} is a maximal subsequence of successive + descents. + Example + p = {3,1,2,5,4}; + ascendingRuns p + descendingRuns p + Text + A permutation $p=(p_1 \, \hdots \, p_n)$ has an \emph{exceedance} at $i$ if + $p(i) > i$; this is called a \emph{weak exceedance} if the inequality is not + strict, i.e., $p(i) \geq i$. + Example + p = {3,1,2,5,4}; + exceedances p + Text + A permutation $p$ has a {\emph saliance} at $i$ if $p(j) < p(i)$ for all $j > i$. + Example + p = {3,1,2,5,4}; + saliances p + Text + A permutation $p$ has a \emph{record} at $i$ if $p(j) < p(i)$ for all $j < i$. + Example + p = {3,1,2,5,4}; + records p + + -- + Text + + {\bf Pattern avoidance.} + + We can check if a permutation avoids a pattern. + For example, a permutation $p$ is $2143$-avoiding if there do not exist + indices $i < j < k < l$ such that $w_j < w_i < w_l < w_k$. + Example + p = permutation {3,1,2,5,4}; + avoidsPattern(p, {2,1,4,3}) + Text + Some patterns are common enough that those pattern-avoiding permutations + are given a name, such as \emph{vexillary} for those that are $2143$-avoiding. + Example + p = permutation {3,1,2,5,4}; + isVexillary p + Text + We can also check if a permutation simultaneously avoids a list of patterns. + Example + p = permutation {3,1,2,5,4}; + avoidsPatterns(p, {{2,1,4,3},{1,4,3,2}}) + Text + Just as before, some lists of patterns are common enough to be given names. + See the documentation for @TO isCartwrightSturmfels@ and @TO isCDG@ for such + lists of patterns. + Example + p = permutation {3,1,2,5,4}; + isCartwrightSturmfels p + isCDG p + + -- + Text + + {\bf Foata's fundamental bijection.} + + Foata's fundamental bijection is a bijection between a permutation's standard + cycle decomposition and another permutation read the same (in one-line notation) + as the decomposition with its parentheses removed. For example, if $p = (3 \, 2 \, 1)(5 \, 4)$ + (written in cycle notation), then its corresponding permutation (written in one-line + notation) is $\hat{p} = (3 \, 2 \, 1 \, 5 \, 4)$. + Example + p = permutation {3,1,2,5,4}; + foataBijection p + + -- + Text + + {\bf Miscellaneous.} + + We can compute the \emph{inverse} of a permutation. + Example + p = {3,1,2,5,4}; + inverse p + Text + The \emph{order} of a permutation $p$ is its order in the symmetric group $\mathfrak{S}_n$, i.e., + the smallest postive integer $k$ such that $p^k$ is the identity permutation. + Example + p = permutation {3,1,2,5,4}; + ord p + Text + Every permutation can be written as a product of transpositions. One definition for the \emph{sign} + of a permutation $p$ is $1$ if it can be written as a product of an even number of transpositions + and is $-1$ if it can be written as an odd number of transpositions. If $\text{sign}(p) = 1$, + the permutation is called \emph{even} and if $\text{sign}(p) = -1 $, it is called \emph{pdd}. + Example + p = permutation {3,1,2,5,4}; + sign p + isEven p + isOdd p + Text + A permutation $p$ is a \emph{derangement} if $p(i) \neq i$ for all $i$. + We can determine if $p$ is a derangement as well its fixed points. + Example + p = permutation {3,1,2,5,4}; + isDerangement p + fixedPoints p + Text + A permutation $p$ has an inversion $(i,j)$ if $i < j$ and $p(i) > p(j)$. + We can compute all the inversions of a permutation. + Example + p = permutation {3,1,2,5,4}; + inversions p + SeeAlso + (symbol _, Permutation, ZZ) + (symbol _, Permutation, List) + (symbol _, Permutation, Sequence) + (symbol ==, Permutation, Permutation) + (symbol *, Permutation, List) + (symbol *, Permutation, Matrix) + (symbol *, Permutation, Permutation) + (symbol ^, Permutation, ZZ) + ascendingRuns + ascents + avoidsPattern + avoidsPatterns + cycleDecomposition + cycleType + descendingRuns + descents + exceedances + expand + fixedPoints + foataBijection + inverse + inversions + isCartwrightSturmfels + isCDG + isDerangement + isEven + isOdd + isValidPermutation + isVexillary + ord + records + reduce + saliances + sign + toMatrix +/// + +-- (symbol _, Permutation, ZZ) +doc /// + Key + (symbol _, Permutation, ZZ) + Headline + selects an element from the permutation when regarded as a list + Usage + w_n + Inputs + w:Permutation + n:ZZ + Outputs + :ZZ + Description + Text + Selects an element from the permutation when it is regarded as a list. + The index should be 1-indexed. + + Given a permutation $p$ and index $i$, this is the same as $p(i)$. + Example + p = permutation {3,1,2,5,4} + p_1 +/// + +-- (symbol _, Permutation, List) +doc /// + Key + (symbol _, Permutation, List) + Headline + selects a subset of the permutation when regarded as a list + Usage + w_l + Inputs + w:Permutation + l:List + Outputs + :List + Description + Text + Selects a subset of the permutation when it is regarded as a list. + It is important to note that the output may not be a valid + permutation. + + The indices should be 0-indexed. + Example + p = permutation {3,1,2,5,4} + p_{1,2} + SeeAlso + (Symbol _, Permutation, Sequence) + (Symbol _, Permutation, ZZ) +/// + +-- (symbol _, Permutation, Sequence) +doc /// + Key + (symbol _, Permutation, Sequence) + Headline + selects a subset of the permutation when regarded as a list + Usage + w_s + Inputs + w:Permutation + s:Sequence + Outputs + :List + Description + Text + Selects a subset of the permutation when it is regarded as a list. + It is important to note that the output may not be a valid + permutation. + + The indices should be 0-indexed. + Example + p = permutation {3,1,2,5,4} + p_(1,2) + SeeAlso + (Symbol _, Permutation, List) + (Symbol _, Permutation, ZZ) +/// + +-- (symbol ==, Permutation, Permutation) +doc /// + Key + (symbol ==, Permutation, Permutation) + Headline + whether two permutations are the same + Usage + w == v + Inputs + w:Permutation + v:Permutation + Outputs + :Boolean + Description + Text + Two permutations $p$ and $q$ are equal if $p(i) = q(i)$ for all $i$. + Example + p = permutation {3,1,2,5,4} + q = permutation {3,1,2,5,4,6,7} + p == q + Text + The permutations do not need to be the same length. + Example + p = permutation {3,1,2,4} + q = permutation {3,1,2,4,5,6} + p == q +/// + +-- (symbol *, Permutation, List) +doc /// + Key + (symbol *, Permutation, List) + Headline + computes the action of a permutation on a list + Usage + w * l + Inputs + w:Permutation + l:List + Outputs + :List + Description + Text + A permutation $p$ acts on the elements of list by permuting the elements + of the list according to the permutation. More precisely, if + $L = \{ e_1, \hdots, e_k \}$ is a list and $p=(p_1, \hdots, p_n)$ is a + permutation, then the action is given by $p*L = \{ e_{p(1)}, \hdots, e_{p(k)}}$. + + The permutation cannot permute more than {\tt #l} elements. + Example + p = permutation {3,1,2,5,4,7,6} + L = {3,1,2,5,4,6,7} + p * L + Text + The permutation can be a permutation on less than {\tt #l} elements. + Example + p = permutation {3,1,2,4,5} + L = {3,1,2,5,4,6,7} + p * L +/// + +-- (symbol *, Permutation, Matrix) +doc /// + Key + (symbol *, Permutation, Matrix) + Headline + computes the action of a permutation on a matrix + Usage + w * M + Inputs + w:Permutation + M:Matrix + Outputs + :Matrix + Description + Text + A permutation $p$ acts on the space of $n \times n$ matrices by permuting + the rows of the matrix according to the permutation. + + The permutation cannot permute more than {\tt numRows M} elements. + Example + p = permutation {3,1,2} + A = matrix {{1,2,3},{4,5,6},{7,8,9}} + p * A + Text + The permutation can be a permutation on less than {\tt numRows M} elements. + Example + p = permutation {3,1,2} + A = matrix {{1,2},{3,4},{5,6}} + p * A +/// + +-- (symbol *, Permutation, Permutation) +doc /// + Key + (symbol *, Permutation, Permutation) + Headline + computes the product of two permutations + Usage + w * v + Inputs + w:Permutation + v:Permutation + Outputs + :Permutation + Description + Text + The product of two permutations $p$ and $q$ is given by their composition, + i.e., $ (p \circ q)(i) = p(q(i))$. + Example + p = permutation {3,1,2,5,4} + q = permutation {2,1,3,4,5} + p * q + Text + The two permutations do not need to be the same length. + Example + p = permutation {3,1,2,5,4} + q = permutation {2,1,3} + p * q +/// + +-- (symbol ^, Permutation, ZZ) +doc /// + Key + (symbol ^, Permutation, ZZ) + Headline + computes the power of a permutation + Usage + w^n + Inputs + w:Permutation + n:Permutation + Outputs + :Permutation + Description + Text + Computes the power of a permutation. The power can be any integer. + Example + p = permutation {3,1,2,5,4} + p^2 + p^0 + p^(-3) +/// + +-- ascendingRuns +doc /// + Key + ascendingRuns + (ascendingRuns, Permutation) + Headline + computes the ascending runs of a permutation + Usage + ascendingRuns w + Inputs + w:Permutation + Outputs + allRuns:List + Description + Text + An \emph{ascending run} is a maximal subsequence of successive ascents. + Example + p = permutation {3,1,2,5,4} + ascendingRuns p + SeeAlso + ascents + descendingRuns + descents + exceedances + saliances + records +/// + +-- ascents +doc /// + Key + ascents + (ascents, Permutation) + Headline + computes the ascents of a permutation + Usage + ascents w + Inputs + w:Permutation + Outputs + :List + Description + Text + A permutation $p=(p_1 \, \hdots \, p_n)$ has an \emph{ascent} at $i$ (for $i < n$) + if $p(i) < p(i+1)$. + Example + p = permutation {3,1,2,5,4} + ascents p + SeeAlso + ascendingRuns + descendingRuns + descents + exceedances + saliances + records +/// + +-- avoidsPattern +doc /// + Key + avoidsPattern + (avoidsPattern, Permutation, List) + Headline + whether a permutation avoids a pattern + Usage + avoidsPattern(w, pattern) + Inputs + w:Permutation + pattern:List + Outputs + isAvoiding:Boolean + Description + Text + Pattern avoidance is more easily understood through an example. + A permutation $p$ is $2143$-avoiding if there do not exist indices + $i < j < k < l$ such that $w_j < w_i < w_l < w_k$. + Example + p = permutation {3,1,2,5,4} + avoidsPattern(p, {2,1,4,3}) + SeeAlso + avoidsPatterns + isCartwrightSturmfels + isCDG + isVexillary +/// + +-- avoidsPatterns +doc /// + Key + avoidsPatterns + (avoidsPatterns, Permutation, List) + Headline + whether a permutation simulataneously avoids a list of patterns + Usage + avoidsPatterns(w, patterns) + Inputs + w:Permutation + patterns:List + Outputs + :Boolean + Description + Text + See @TO avoidsPattern@ for more information on pattern avoidance. + Example + p = permutation {3,1,2,5,4} + avoidsPatterns(p, {{2,1,4,3}, {1,4,3,2}}) + SeeAlso + avoidsPattern + isCartwrightSturmfels + isCDG + isVexillary +/// + +-- cycleDecomposition +doc /// + Key + cycleDecomposition + (cycleDecomposition, Permutation) + Headline + computes the decomposition of a permutation as a product of disjoint cycles + Usage + cycleDecomposition w + Inputs + w:Permutation + Outputs + :List + Description + Text + Every permutation can be decomposed into a product of disjoint cycles. + We follow the convention to write the decomposition in its "canonical" or + "standard" form. So + + 1. each cycle is listed with its largest element first, and @BR{}@ + 2. the cycles are listed in increasing order. + Example + p = permutation {3,1,2,5,4} + cycleDecomposition p + SeeAlso + cycleType +/// + +-- cycleType +doc /// + Key + cycleType + (cycleType, Permutation) + Headline + computes the cycle type of a permutation + Usage + cycleType w + Inputs + w:Permutation + Outputs + :Sequence + Description + Text + A permutation's \emph{cycle type} is the sequence consisting of the lengths of the + cycles in its cycle decomposition, listed in weakly decreasing order. + Example + p = permutation {3,1,2,5,4} + cycleType p + SeeAlso + cycleDecomposition +/// + +-- descendingRuns +doc /// + Key + descendingRuns + (descendingRuns, Permutation) + Headline + computes the descending runs of a permutation + Usage + descendingRuns w + Inputs + w:Permutation + Outputs + allRuns:List + Description + Text + A \emph{descending run} is a maximal subsequence of successive descents. + Example + p = permutation {3,1,2,5,4} + descendingRuns p + SeeAlso + ascendingRuns + ascents + descents + exceedances + saliances + records +/// + +-- descents +doc /// + Key + descents + (descents, Permutation) + Headline + computes the descents of a permutation + Usage + descents w + Inputs + w:Permutation + Outputs + :List + Description + Text + A permutation $p=(p_1 \, \hdots \, p_n)$ has a \emph{descent} at $i$ (for $i < n$) + if $p(i) > p(i+1)$. + Example + p = permutation {3,1,2,5,4} + descents p + SeeAlso + ascendingRuns + ascents + descendingRuns + exceedances + saliances + records +/// + +-- exceedances +-- TODO: how to document optional inputs? +doc /// + Key + exceedances + (exceedances, Permutation) + Headline + computes the exceedances of a permutation + Usage + exceedances w + exceedances(w, Weak) + Inputs + w:Permutation + Outputs + :List + Description + Text + A permutation $p=(p_1 \, \hdots \, p_n)$ has an \emph{exceedance} at $i$ if + $p(i) > i$. + Example + p = permutation {3,1,2,5,4} + exceedances p + Text + This is called a \emph{weak exceedance} if the inequality is not + strict, i.e., $p(i) \geq i$. + Example + p = permutation {3,1,2,5,4} + exceedances(p, Weak=>true) + SeeAlso + ascendingRuns + ascents + descendingRuns + descents + saliances + records +/// + +-- expand(w,n) +doc /// + Key + expand + (expand, Permutation, ZZ) + Headline + rewrites a permutation as a permution on more symbols + Usage + expand(w,n) + Inputs + w:Permutation + n:ZZ + Outputs + :Boolean + Description + Text + A permutation on $n$ symbols is an element of the symmetric group on $n$ + symbols, $\mathfrak{S}_n$. However, it can also be regarded as a permutation + on $N > n$ symbols as well by fixing the $(n+1)$st through $N$th symbols. + Example + p = permutation {3,1,2,5,4} + expance(p, 7) + SeeAlso + reduce +/// + +-- expand(w,v) +-- TODO: how to write documentation for tuple output +doc /// + Key + expand(Permutation,Permutation) + Headline + rewrites two permutations to be permutations on the same number of symbols + Usage + expand(w,v) + Inputs + w:Permutation + v:Permutation + Outputs + :List + Description + Text + For ease, we can also expand two permutations so that they are regarded as + permutations on the same number of symbols. More precisely, if we have + permutations $p=(p_1, \hdots, p_n)$ and $q=(q_1, \hdots, q_m)$, then + {\tt expand(p,q)} will return both $p$ and $q$ as permutations on + $\text{max}(m,n)$ symbols. + Example + p = permutation {3,1,2,5,4} + q = permutation {2,3,1,4,5,7,6} + expand(p,q) + SeeAlso + expand(Permutation,ZZ) + reduce +/// + +-- fixedPoints +doc /// + Key + fixedPoints + (fixedPoints, Permutation) + Headline + computes the fixed points of a permutation + Usage + fixedPoints w + Inputs + w:Permutation + Outputs + :List + Description + Text + A permutation $p$ has a {\emph fixed point} at $i$ if $p(i) = i$. + {\tt fixedPoints} computes all of the fixed points of a permutation. + Example + p = permutation {2,1,3,5,4} + fixedPoints p + SeeAlso + isDerangement +/// + +-- foataBijection +doc /// + Key + foataBijection + (foataBijection, Permutation) + Headline + computes the image of a permutation under the Foata bijection + Usage + foataBijection w + Inputs + w:Permutation + Outputs + :Permutation + Description + Text + Foata's fundamental bijection is a bijection between a permutation's standard + cycle decomposition and another permutation read the same (in one-line notation) + as the decomposition with its parentheses removed. For example, if $p = (3 \, 2 \, 1)(5 \, 4)$ + (written in cycle notation), then its corresponding permutation (written in one-line + notation) is $\hat{p} = (3 \, 2 \, 1 \, 5 \, 4)$. + Example + p = permutation {3,1,2,5,4} + foataBijection p +/// + +-- inverse(w) +doc /// + Key + (inverse, Permutation) + Headline + computes the inverse of a permutation + Usage + inverse w + Inputs + w:Permutation + Outputs + :Permutation + Description + Example + p = permutation {3,1,2,5,4} + fixedPoints p +/// + +-- inversions +doc /// + Key + inversions + (inversions, Permutation) + Headline + computes the inversions of a permutation + Usage + inversions w + Inputs + w:Permutation + Outputs + :List + Description + Text + A permutation $p$ has an {\emph inversion} $(i,j)$ if $i < j$ and $p(i) > p(j)$. + {\tt inversions} computes all of the inversions of a permutation. + Example + p = permutation {3,1,2,5,4} + inversions p +/// + +-- isCartwrightSturmfels +-- TODO: add list of patterns to description +doc /// + Key + isCartwrightSturmfels + (isCartwrightSturmfels, Permutation) + Headline + whether a permutation is Cartwright-Sturmfels + Usage + isVexillary w + Inputs + w:Permutation + Outputs + :Boolean + Description + Text + A permutation $p$ is {\emph Cartwright-Sturmfels} if it avoids. + Example + p = permutation {3,1,2,5,4} + isCartwrightSturmfels p + SeeAlso + avoidsPattern + avoidsPatterns + isCDG + isVexillary +/// + +-- isCDG +-- TODO: add CDG spelled out to headline and description +-- TODO add list of patterns to description +doc /// + Key + isCDG + (isCDG, Permutation) + Headline + whether a permutation is CDG. + Usage + isCDG w + Inputs + w:Permutation + Outputs + :Boolean + Description + Text + A permutation $p$ is {\emph CDG} if it avoids. + Example + p = permutation {3,1,2,5,4} + isCDG p + SeeAlso + avoidsPattern + avoidsPatterns + isCartwrightSturmfels + isVexillary +/// + +-- isDerangement +doc /// + Key + isDerangement + (isDerangement, Permutation) + Headline + whether a permutation is a derangement + Usage + fixedPoints w + Inputs + w:Permutation + Outputs + :Boolean + Description + Text + A permutation $p$ is a {\emph derangement} if it has no fixed points. + Example + p = permutation {3,1,2,5,4} + isDerangement p + SeeAlso + fixedPoints +/// + +-- isEven +doc /// + Key + isEven + (isEven, Permutation) + Headline + whether a permutation is even + Usage + isEven w + Inputs + w:Permutation + Outputs + :Boolean + Description + Text + A permutation $p$ is {\emph even} if it can be written as a product of an + even number of transpositions. Equivalently, a permutation is even if its + @TO sign@ is $1$. + Example + p = permutation {3,1,2,5,4} + isEven p + SeeAlso + isOdd + sign +/// + +-- isOdd +doc /// + Key + isOdd + (isOdd, Permutation) + Headline + whether a permutation is odd + Usage + isOdd w + Inputs + w:Permutation + Outputs + :Boolean + Description + Text + A permutation $p$ is {\emph odd} if it can be written as a product of an + odd number of transpositions. Equivalently, a permutation is odd if its + @TO sign@ is $-1$. + Example + p = permutation {3,1,2,5,4} + isOdd p + SeeAlso + isEven + sign +/// + +-- isValidPermutation +doc /// + Key + isValidPermutation + (isValidPermutation, List) + Headline + checks if a list is a valid permutation + Usage + isValidPermutation w + isValidPermutation(w) + Inputs + w:List + Outputs + :Boolean + Description + Text + @TT "isValidPermutation p"@ determines if @TT "p"@ is a valid permutation. + Permutations must be constructed from lists consisting of only the integers + $1 \textemdash n$. If a list contains any other elements or does not consist of the entire + range, then an error is thrown. + Example + isValidPermutation {1, 2, 3} + isValidPermutation {0, 1, 2} + isValidPermutation {1, 1, 2} +/// + +-- isVexillary +doc /// + Key + isVexillary + (isVexillary, Permutation) + Headline + whether a permutation is vexillary + Usage + isVexillary w + Inputs + w:Permutation + Outputs + :Boolean + Description + Text + A permutation $p$ is {\emph vexillary} if it is $2143$-avoiding. + Example + p = permutation {3,1,2,5,4} + isVexillary p + SeeAlso + avoidsPattern + avoidsPatterns + isCartwrightSturmfels + isCDG +/// + +-- ord +doc /// + Key + ord + (ord, Permutation) + Headline + computes the order of a permutation + Usage + ord w + Inputs + w:Permutation + Outputs + :ZZ + Description + Text + The {\emph order} of a permutation $p$ is the smallest positive integer + $n$ such that $p^n$ is the identity permutation, i.e., its order in the + symmetric group. + Example + p = permutation {3,1,2,5,4} + ord p +/// + +-- records +doc /// + Key + records + (records, Permutation) + Headline + computes the saliances of a permutation + Usage + records w + Inputs + w:Permutation + Outputs + :List + Description + Text + A permutation $p$ has a {\emph record} at $i$ if $p(j) < p(i)$ for all $j < i$. + Example + p = permutation {3,1,2,5,4} + saliances p + SeeAlso + ascendingRuns + ascents + descendingRuns + descents + exceedances + saliances +/// + +-- reduce +doc /// + Key + reduce + (reduce, Permutation) + Headline + rewrites a permutation in its smallest representation + Usage + reduce w + Inputs + w:Permutation + Outputs + :Permutation + Description + Text + {\tt reduce} rewrites a permutation $p$ as a permutation in $S_n$, + where $n$ is the smallest integer such that $p$ is in $\mathfrak{S}_n$. + In other words, it returns a permutation where any extraneous fixed points + are removed. + Example + p = permutation {3,1,2,5,4,6,7} + reduce p + SeeAlso + expand +/// + +-- saliances +doc /// + Key + saliances + (saliances, Permutation) + Headline + computes the saliances of a permutation + Usage + saliances w + Inputs + w:Permutation + Outputs + :List + Description + Text + A permutation $p$ has a {\emph saliance} at $i$ if $p(j) < p(i)$ for all $j > i$. + Example + p = permutation {3,1,2,5,4} + saliances p + SeeAlso + ascendingRuns + ascents + descendingRuns + descents + exceedances + records +/// + +-- sign +doc /// + Key + sign + (sign, Permutation) + Headline + computes the sign of a permutation + Usage + sign w + Inputs + w:Permutation + Outputs + :ZZ + Description + Text + Every permutation can be written as a product of transpositions. One definition for the \emph{sign} + of a permutation $p$ is $1$ if it can be written as a product of an even number of transpositions + and is $-1$ if it can be written as an odd number of transpositions. + Example + p = permutation {3,1,2,5,4} + sign p + SeeAlso + cycleDecomposition + cycleType + isEven + isOdd +/// + +-- toMatrix +doc /// + Key + toMatrix + (toMatrix, Permutation) + Headline + computes the matrix representation of a permutation + Usage + toMatrix w + Inputs + w:Permutation + Outputs + :Matrix + Description + Text + Every permutation $p$ on $n$ symbols can be written as an $n \times n$ + matrix. Its matrix representation has a $1$ in entry $(i,j)$ if $p(i) = j$ + and $0$ otherwise. + Example + p = permutation {3,1,2,5,4} + toMatrix p + SeeAlso + (Symbol *, Permutation, Matrix) +/// + +-- Local Variables: +-- compile-command: "make -C $M2BUILDDIR/Macaulay2/m2 " +-- End: diff --git a/M2/Macaulay2/tests/normal/permutations.m2 b/M2/Macaulay2/tests/normal/permutations.m2 index 44aaf93449f..c51aa0282ce 100644 --- a/M2/Macaulay2/tests/normal/permutations.m2 +++ b/M2/Macaulay2/tests/normal/permutations.m2 @@ -3,3 +3,230 @@ v = {1,2,4,3,0} w = {3,1,2,4,0} assert(f_(v_w)==(f_v)_w) assert(f_(v_w)==(f_v)*(f_w)) + +----------------------------------------------------------------------------- +-- Permutation class +----------------------------------------------------------------------------- +-- Should expression, string, TeX, and HTML outputs be tested? + +-- valid permutations should be nonempty lists consisting of only all numbers 1..n +assert(isValidPermutation {1}) +assert(isValidPermutation toList (1..8)) +assert(isValidPermutation random toList (1..8)) +assert(not isValidPermutation {}) +assert(not isValidPermutation {0}) +assert(not isValidPermutation toList (0..8)) +assert(not isValidPermutation random toList (0..8)) +assert(not isValidPermutation {1,1,2}) + +----------------------- +-- identity permutation +----------------------- +reducedIdentity = permutation {1} +expandedIdentity = permutation toList (1..8) +expandedList = toList (1 .. #expandedIdentity) + +-- indexing into a permutation +assert(reducedIdentity_0 == 1) +assert(expandedIdentity_{0..2} == {1,2,3}) +assert(expandedIdentity_{0,2,4,6} == {1,3,5,7}) +assert(expandedIdentity_(0..2) == {1,2,3}) +assert(expandedIdentity_(0,2,4,6) == {1,3,5,7}) + +-- expand and reduce are inverse processes +assert(reduce expandedIdentity == reducedIdentity) +assert(expand(reducedIdentity, #expandedIdentity) == expandedIdentity) +assert(reduce expand(reducedIdentity, #expandedIdentity) == reducedIdentity) +assert(expand(reduce expandedIdentity, #expandedIdentity) == expandedIdentity) + +-- basic operations +-- equality +assert(reducedIdentity == expandedIdentity) +assert(reducedIdentity != permutation reverse expandedList) +assert(expandedIdentity != permutation reverse expandedList) +-- multiplication +assert(reducedIdentity*reducedIdentity == reducedIdentity) +assert(reducedIdentity*expandedIdentity == reducedIdentity) +assert(expandedIdentity*expandedIdentity == reducedIdentity) +assert(expandedIdentity*(permutation switch(0, 1, expandedList)) == permutation switch(0, 1, expandedList)) +assert((permutation switch(0, 1, expandedList))*expandedIdentity == (permutation switch(0, 1, expandedList))) +-- powers +assert(reducedIdentity^2 == reducedIdentity) +assert(reducedIdentity^5 == reducedIdentity) +assert(reducedIdentity^(-1) == reducedIdentity) +assert(reducedIdentity^(-5) == reducedIdentity) +assert(reducedIdentity^0 == reducedIdentity) + +-- matrix representation +assert(toMatrix reducedIdentity == id_(ZZ^1)) +assert(toMatrix expandedIdentity == id_(ZZ^(#expandedIdentity))) + +-- Group actions +assert(reducedIdentity * {1} == {1}) +assert(reducedIdentity * {1,2,3} == {1,2,3}) +assert(reducedIdentity * {3,1,2} == {3,1,2}) +assert(expandedIdentity * toList(1 .. #expandedIdentity) == toList(1 .. #expandedIdentity)) +assert(expandedIdentity * toList(1 .. #expandedIdentity+2) == toList(1 .. #expandedIdentity+2)) +assert(expandedIdentity * switch(0, 1, toList(1 .. #expandedIdentity+2)) == switch(0, 1, toList(1 .. #expandedIdentity+2))) + +assert(reducedIdentity * (toMatrix reducedIdentity) == toMatrix reducedIdentity) +assert(reducedIdentity * (toMatrix expand(reducedIdentity, 3)) == toMatrix expand(reducedIdentity, 3)) +assert(reducedIdentity * (toMatrix permutation {3,1,2}) == toMatrix permutation {3,1,2}) +assert(expandedIdentity * (toMatrix expand(expandedIdentity, #expandedIdentity+2)) == toMatrix expand(expandedIdentity, #expandedIdentity+2)) +assert(expandedIdentity * (toMatrix permutation switch(0, 1, toList(1 .. #expandedIdentity+2))) == toMatrix permutation switch(0, 1, toList(1 .. #expandedIdentity+2))) + +-- cycle decomposition +assert(cycleDecomposition reducedIdentity == {1:1}) +assert(cycleDecomposition expandedIdentity == for i in 1 .. #expandedIdentity list 1:i) +assert(cycleType reducedIdentity == 1:1) +assert(cycleType expandedIdentity == (#expandedIdentity):1) + +-- Ascents, descents, runs, exceedances, and records +assert(ascents reducedIdentity == {}) +assert(ascents expandedIdentity == toList (1 .. #expandedIdentity-1)) +assert(descents reducedIdentity == {}) +assert(descents expandedIdentity == {}) +assert(ascendingRuns reducedIdentity == {1:1}) +assert(ascendingRuns expandedIdentity == {(1 .. #expandedIdentity)}) +assert(descendingRuns reducedIdentity == {1:1}) +assert(descendingRuns expandedIdentity == for i in (1 .. #expandedIdentity) list 1:i) +assert(exceedances reducedIdentity == {}) +assert(exceedances expandedIdentity == {}) +assert(exceedances(reducedIdentity, Weak=>true) == {1}) +assert(exceedances(expandedIdentity, Weak=>true) == expandedList) +assert(saliances reducedIdentity == {last reducedIdentity}) +assert(saliances expandedIdentity == {last expandedIdentity}) +assert(records reducedIdentity == {1}) +assert(records expandedIdentity == expandedList) + +-- pattern avoidance +assert(isVexillary reducedIdentity) +assert(isVexillary expandedIdentity) +assert(isCartwrightSturmfels reducedIdentity) +assert(isCartwrightSturmfels expandedIdentity) +assert(isCDG reducedIdentity) +assert(isCDG expandedIdentity) + +-- Foata's fundamental bijection +assert(foataBijection reducedIdentity == reducedIdentity) +assert(foataBijection expandedIdentity == expandedIdentity) + +-- miscellaneous +assert(inverse reducedIdentity == reducedIdentity) +assert(inverse expandedIdentity == expandedIdentity) +assert(ord reducedIdentity == 1) +assert(ord expandedIdentity == 1) +assert(sign reducedIdentity == 1) +assert(sign expandedIdentity == 1) +assert(isEven reducedIdentity) +assert(isEven expandedIdentity) +assert(not isOdd reducedIdentity) +assert(not isOdd expandedIdentity) +assert(not isDerangement reducedIdentity) +assert(not isDerangement expandedIdentity) +assert(fixedPoints reducedIdentity == {1}) +assert(fixedPoints expandedIdentity == expandedList) +assert(inversions reducedIdentity == {}) +assert(inversions expandedIdentity == {}) + +----------------------- +-- longest permutation +----------------------- +p = permutation reverse toList (1..10) +pList = toList p +expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + +-- indexing into a permutation +assert(p_0 == 10) +assert(p_{0..2} == {10,9,8}) +assert(p_{0,2,4,6,8} == {10,8,6,4,2}) +assert(p_(0..2) == {10,9,8}) +assert(p_(0,2,4,6,8) == {10,8,6,4,2}) + +-- expand and reduce are inverse processes +assert(reduce p == p) +assert(expand(p, #p+2) == expandedP) +assert(reduce expand(p, #p+2) == p) + +-- basic operations +-- equality +assert(p == expandedP) +assert(reducedIdentity != permutation reverse expandedList) +-- multiplication +assert(reducedIdentity*reducedIdentity == reducedIdentity) +-- powers +assert(p^2 == reducedIdentity) +assert(p^5 == p) +assert(p^(-1) == p) +assert(p^(-5) == p) +assert(p^0 == reducedIdentity) + +-- matrix representation +antiDiagIdentity = matrix for i in (0 ..< #p) list for j in (0 ..< #p) list if i+j == #p-1 then 1 else 0 +assert(toMatrix p == antiDiagIdentity) + +-- Group actions +assert(p * toList(1 .. #p) == pList) +assert(p * toList(1 .. #p+2) == toList expandedP) +assert(p * {5,4,3,2,1,10,9,8,7,6} == {6,7,8,9,10,1,2,3,4,5}) + +assert(p * (toMatrix p) == id_(ZZ^#p)) +assert(p * (toMatrix permutation {6,7,8,9,10,1,2,3,4,5}) == matrix {{0,0,0,0,1,0,0,0,0,0}, + {0,0,0,1,0,0,0,0,0,0}, + {0,0,1,0,0,0,0,0,0,0}, + {0,1,0,0,0,0,0,0,0,0}, + {1,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,1}, + {0,0,0,0,0,0,0,0,1,0}, + {0,0,0,0,0,0,0,1,0,0}, + {0,0,0,0,0,0,1,0,0,0}, + {0,0,0,0,0,1,0,0,0,0}}) + +-- cycle decomposition +assert(cycleDecomposition p == {(6,5), (7,4), (8,3), (9,2), (10,1)}) +assert(cycleType p == (2,2,2,2,2)) + +-- Ascents, descents, runs, exceedances, and records +assert(ascents p == {}) +assert(descents p == {1,2,3,4,5,6,7,8,9}) +assert(ascendingRuns p == for i in reverse (1 .. #p) list 1:i) +assert(descendingRuns p == {reverse (1 .. #p)}) +assert(exceedances p == {1,2,3,4,5}) +assert(exceedances(p, Weak=>true) == {1,2,3,4,5}) +assert(saliances p == toList(1 .. #p)) +assert(records p == {1}) + +-- pattern avoidance +assert(isVexillary p) +assert(isCartwrightSturmfels p) +assert(isCDG p) + +-- Foata's fundamental bijection +assert(foataBijection p == permutation {6,5,7,4,8,3,9,2,10,1}) + +-- miscellaneous +assert(inverse p == p) +assert(ord p == 2) +assert(sign p == -1) +assert(not isEven p) +assert(isOdd p) +assert(isDerangement p) +assert(fixedPoints p == {}) +assert(sort inversions p == sort subsets(1 .. #p, 2)) + + +------- +-- Misc +------- +p = permutation random toList (1..10) +assert((inverse p)*p == reducedIdentity) +assert(p*(inverse p) == reducedIdentity) +assert(ord p == ord inverse p) +assert(cycleType p == cycleType inverse p) +assert(sign p == sign inverse p) + +-- some more pattern avoidance +assert(not avoidsPattern(permutation {2,3,7,1,5,8,4,6}, {1,4,3,2})) +assert(avoidsPattern(permutation {1,4,6,2,3,7,5}, {1,4,3,2})) +assert(not isVexillary(permutation {7,2,5,8,1,3,6,4})) +assert(isVexillary(permutation {1,6,9,2,4,7,3,5,8})) From 138d1b260e53d750445720962d93a694702b4d1f Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Thu, 6 Jun 2024 13:39:35 -0500 Subject: [PATCH 002/226] Refactored permutations code into Permutations package --- M2/Macaulay2/packages/Permutations.m2 | 98 +++++ .../Permutations/Permutations.m2} | 13 +- .../PermutationsDOC.m2} | 155 ++++--- .../Permutations/PermutationsTests.m2 | 414 ++++++++++++++++++ M2/Macaulay2/tests/normal/permutations.m2 | 232 ---------- 5 files changed, 595 insertions(+), 317 deletions(-) create mode 100644 M2/Macaulay2/packages/Permutations.m2 rename M2/Macaulay2/{m2/permutations.m2 => packages/Permutations/Permutations.m2} (97%) rename M2/Macaulay2/packages/{Macaulay2Doc/doc_permutations.m2 => Permutations/PermutationsDOC.m2} (93%) create mode 100644 M2/Macaulay2/packages/Permutations/PermutationsTests.m2 delete mode 100644 M2/Macaulay2/tests/normal/permutations.m2 diff --git a/M2/Macaulay2/packages/Permutations.m2 b/M2/Macaulay2/packages/Permutations.m2 new file mode 100644 index 00000000000..87d49d06450 --- /dev/null +++ b/M2/Macaulay2/packages/Permutations.m2 @@ -0,0 +1,98 @@ +newPackage( + "Permutations", + AuxiliaryFiles => true, + Version => "1.0", + Date => "June 4, 2024", + Keywords => {"Combinatorics"}, + Authors => { + {Name => "Sean Grate", + Email => "sean.grate@auburn.edu", + HomePage => "https://seangrate.com/"} + }, + Headline => "functions for working with permutations", + PackageExports => { + -- "SimplicialComplexes", + -- "SimplicialDecomposability", + -- "Posets", + -- "MinimalPrimes" + }, + DebuggingMode => true +) + +export{ + -- types + "Permutation", + -- methods + "permutation", + "isValidPermutation", + "reduce", + "expand", + "toMatrix", + "cycleDecomposition", + "cycleType", + "ascents", + "descents", + "ascendingRuns", + "descendingRuns", + "exceedances", + "saliances", + "records", + "avoidsPattern", + "avoidsPatterns", + "isVexillary", + "isCartwrightSturmfels", + "isCDG", + "foataBijection", + -- "inverse", + "ord", + "sign", + "isEven", + "isOdd", + "isDerangement", + "fixedPoints", + "inversions", + -- symbols + "Weak" +} + +------------------------------------------------------------------------------ +------------------------------------------------------------------------------ +-- **CODE** -- +------------------------------------------------------------------------------ +------------------------------------------------------------------------------ +load "./Permutations/Permutations.m2" +------------------------------------------------------------------------------ +------------------------------------------------------------------------------ +-- **DOCUMENTATION** -- +------------------------------------------------------------------------------ +------------------------------------------------------------------------------ +beginDocumentation () +load "./Permutations/PermutationsDOC.m2" +------------------------------------------------------------------------------ +------------------------------------------------------------------------------ +-- **TESTS** -- +------------------------------------------------------------------------------ +------------------------------------------------------------------------------ +load "./Permutations/PermutationsTests.m2" + +end--------------------------------------------------------------------------- + +------------------------------------------------------------------------------ +------------------------------------------------------------------------------ +-- **SCRATCH SPACE** -- +------------------------------------------------------------------------------ +------------------------------------------------------------------------------ + + +------------------------------------ +--Development Section +------------------------------------ + +restart +uninstallPackage "Permutations" +restart +installPackage "Permutations" +restart +needsPackage "Permutations" +elapsedTime check "Permutations" +viewHelp "Permutations" \ No newline at end of file diff --git a/M2/Macaulay2/m2/permutations.m2 b/M2/Macaulay2/packages/Permutations/Permutations.m2 similarity index 97% rename from M2/Macaulay2/m2/permutations.m2 rename to M2/Macaulay2/packages/Permutations/Permutations.m2 index c38589434a4..93d1bf5670e 100644 --- a/M2/Macaulay2/m2/permutations.m2 +++ b/M2/Macaulay2/packages/Permutations/Permutations.m2 @@ -36,7 +36,7 @@ html Permutation := w -> html expression toList w ----------------------------------------------------------------------------- -- Indexing permutations as lists ----------------------------------------------------------------------------- -Permutation _ ZZ := List => (w,n) -> ((toList w)_(n-1)) +Permutation _ ZZ := ZZ => (w,n) -> ((toList w)_(n-1)) Permutation _ List := List => (w,l) -> ((toList w)_l) Permutation _ Sequence := List => (w,s) -> ((toList w)_(toList s)) @@ -56,7 +56,7 @@ expand (Permutation, ZZ) := Permutation => (w,n) -> ( if n < #w then error(toString w | " is a permutation on more than " | toString n | " letters."); permutation(toList(w) | toList(#w+1..n)) ) -expand (Permutation, Permutation) := (Permutation, Permutation) => (w,v) -> ( +expand (Permutation, Permutation) := Sequence => (w,v) -> ( n := max(#w, #v); (expand(w,n), expand(v,n)) ) @@ -95,7 +95,7 @@ Permutation * List := List => (w, l) -> ( ) -- group action on a matrix permutes the ROWS of the matrix -- maybe would prefer to permute the columns? Seems more natural -Permutation * Matrix := List => (w, M) -> ( +Permutation * Matrix := Matrix => (w, M) -> ( m := numRows M; if #(reduce w) > m then error(toString w | " permutes more than " | toString m | " elements.") else (toMatrix expand(w, m)) * M @@ -156,7 +156,7 @@ ascendingRuns Permutation := List => w -> ( if #w == 1 then allRuns := {toSequence w} else ( allRuns = {}; - currentRun = {w#0}; + currentRun := {w#0}; for wi in w_(toList(1 ..< #w)) do ( if wi > last currentRun then currentRun = append(currentRun, wi) else ( @@ -176,7 +176,7 @@ descendingRuns Permutation := List => w -> ( if #w == 1 then allRuns := {toSequence w} else ( allRuns = {}; - currentRun = {w#0}; + currentRun := {w#0}; for wi in w_(toList(1 ..< #w)) do ( if wi < last currentRun then currentRun = append(currentRun, wi) else ( @@ -274,6 +274,7 @@ foataBijection Permutation := Permutation => w -> ( ----------------------------------------------------------------------------- -- Miscellaneous ----------------------------------------------------------------------------- +-- inverse = method() inverse Permutation := Permutation => w -> (permutation to1Index inversePermutation to0Index toList w) -- order of a permutation, i.e. smallest integer n such that w^n = identity @@ -308,5 +309,5 @@ fixedPoints Permutation := Boolean => w -> (for cycle in cycleDecomposition w li inversions = method(TypicalValue => List) inversions Permutation := List => w -> ( - for idxPair in sort(subsets(toList w, 2) / sort) list if w_(idxPair#0 - 1) > w_(idxPair#1 - 1) then idxPair else continue + for idxPair in sort(subsets(toList w, 2) / sort) list if w_(idxPair#0) > w_(idxPair#1) then idxPair else continue ) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc_permutations.m2 b/M2/Macaulay2/packages/Permutations/PermutationsDOC.m2 similarity index 93% rename from M2/Macaulay2/packages/Macaulay2Doc/doc_permutations.m2 rename to M2/Macaulay2/packages/Permutations/PermutationsDOC.m2 index 6664e448ddf..2b82f4df958 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc_permutations.m2 +++ b/M2/Macaulay2/packages/Permutations/PermutationsDOC.m2 @@ -153,7 +153,7 @@ doc /// $p(i) > p(i+1)$. We can compute the set of ascents and the set of descents using {\tt ascents} and {\tt descents}, respectively. Example - p = {3,1,2,5,4}; + p = permutation {3,1,2,5,4}; ascents p descents p Text @@ -161,7 +161,7 @@ doc /// Similarly, a \emph{descending run} is a maximal subsequence of successive descents. Example - p = {3,1,2,5,4}; + p = permutation {3,1,2,5,4}; ascendingRuns p descendingRuns p Text @@ -169,17 +169,17 @@ doc /// $p(i) > i$; this is called a \emph{weak exceedance} if the inequality is not strict, i.e., $p(i) \geq i$. Example - p = {3,1,2,5,4}; + p = permutation {3,1,2,5,4}; exceedances p Text A permutation $p$ has a {\emph saliance} at $i$ if $p(j) < p(i)$ for all $j > i$. Example - p = {3,1,2,5,4}; + p = permutation {3,1,2,5,4}; saliances p Text A permutation $p$ has a \emph{record} at $i$ if $p(j) < p(i)$ for all $j < i$. Example - p = {3,1,2,5,4}; + p = permutation {3,1,2,5,4}; records p -- @@ -234,7 +234,7 @@ doc /// We can compute the \emph{inverse} of a permutation. Example - p = {3,1,2,5,4}; + p = permutation {3,1,2,5,4}; inverse p Text The \emph{order} of a permutation $p$ is its order in the symmetric group $\mathfrak{S}_n$, i.e., @@ -265,42 +265,42 @@ doc /// Example p = permutation {3,1,2,5,4}; inversions p - SeeAlso - (symbol _, Permutation, ZZ) - (symbol _, Permutation, List) - (symbol _, Permutation, Sequence) - (symbol ==, Permutation, Permutation) - (symbol *, Permutation, List) - (symbol *, Permutation, Matrix) - (symbol *, Permutation, Permutation) - (symbol ^, Permutation, ZZ) - ascendingRuns - ascents - avoidsPattern - avoidsPatterns - cycleDecomposition - cycleType - descendingRuns - descents - exceedances - expand - fixedPoints - foataBijection - inverse - inversions - isCartwrightSturmfels - isCDG - isDerangement - isEven - isOdd - isValidPermutation - isVexillary - ord - records - reduce - saliances - sign - toMatrix + SeeAlso + (symbol _, Permutation, ZZ) + (symbol _, Permutation, List) + (symbol _, Permutation, Sequence) + (symbol ==, Permutation, Permutation) + (symbol *, Permutation, List) + (symbol *, Permutation, Matrix) + (symbol *, Permutation, Permutation) + (symbol ^, Permutation, ZZ) + ascendingRuns + ascents + avoidsPattern + avoidsPatterns + cycleDecomposition + cycleType + descendingRuns + descents + exceedances + expand + fixedPoints + foataBijection + inverse + inversions + isCartwrightSturmfels + isCDG + isDerangement + isEven + isOdd + isValidPermutation + isVexillary + ord + records + reduce + saliances + sign + toMatrix /// -- (symbol _, Permutation, ZZ) @@ -351,8 +351,8 @@ doc /// p = permutation {3,1,2,5,4} p_{1,2} SeeAlso - (Symbol _, Permutation, Sequence) - (Symbol _, Permutation, ZZ) + (symbol _, Permutation, Sequence) + (symbol _, Permutation, ZZ) /// -- (symbol _, Permutation, Sequence) @@ -379,8 +379,8 @@ doc /// p = permutation {3,1,2,5,4} p_(1,2) SeeAlso - (Symbol _, Permutation, List) - (Symbol _, Permutation, ZZ) + (symbol _, Permutation, List) + (symbol _, Permutation, ZZ) /// -- (symbol ==, Permutation, Permutation) @@ -514,7 +514,7 @@ doc /// w^n Inputs w:Permutation - n:Permutation + n:ZZ Outputs :Permutation Description @@ -799,7 +799,7 @@ doc /// w:Permutation n:ZZ Outputs - :Boolean + :Permutation Description Text A permutation on $n$ symbols is an element of the symmetric group on $n$ @@ -807,7 +807,7 @@ doc /// on $N > n$ symbols as well by fixing the $(n+1)$st through $N$th symbols. Example p = permutation {3,1,2,5,4} - expance(p, 7) + expand(p, 7) SeeAlso reduce /// @@ -815,31 +815,32 @@ doc /// -- expand(w,v) -- TODO: how to write documentation for tuple output doc /// - Key - expand(Permutation,Permutation) - Headline - rewrites two permutations to be permutations on the same number of symbols - Usage - expand(w,v) - Inputs - w:Permutation - v:Permutation - Outputs - :List - Description - Text - For ease, we can also expand two permutations so that they are regarded as - permutations on the same number of symbols. More precisely, if we have - permutations $p=(p_1, \hdots, p_n)$ and $q=(q_1, \hdots, q_m)$, then - {\tt expand(p,q)} will return both $p$ and $q$ as permutations on - $\text{max}(m,n)$ symbols. - Example - p = permutation {3,1,2,5,4} - q = permutation {2,3,1,4,5,7,6} - expand(p,q) - SeeAlso - expand(Permutation,ZZ) - reduce +Key + (expand, Permutation, Permutation) +Headline + rewrites two permutations to be permutations on the same number of symbols +Usage + e = expand(w,v) +Inputs + w:Permutation + v:Permutation +Outputs + e:Sequence +Description + Text + For ease, we can also expand two permutations so that they are regarded as + permutations on the same number of symbols. More precisely, if we have + permutations $p=(p_1, \hdots, p_n)$ and $q=(q_1, \hdots, q_m)$, then + {\tt expand(p,q)} will return both $p$ and $q$ as permutations on + $\text{max}(m,n)$ symbols. + Example + p = permutation {3,1,2,5,4} + q = permutation {2,3,1,4,5,7,6} + expand(p,q) +SeeAlso + (expand, Permutation, ZZ) + reduce + /// -- fixedPoints @@ -1268,9 +1269,5 @@ doc /// p = permutation {3,1,2,5,4} toMatrix p SeeAlso - (Symbol *, Permutation, Matrix) + (symbol *, Permutation, Matrix) /// - --- Local Variables: --- compile-command: "make -C $M2BUILDDIR/Macaulay2/m2 " --- End: diff --git a/M2/Macaulay2/packages/Permutations/PermutationsTests.m2 b/M2/Macaulay2/packages/Permutations/PermutationsTests.m2 new file mode 100644 index 00000000000..f9e8eeb194a --- /dev/null +++ b/M2/Macaulay2/packages/Permutations/PermutationsTests.m2 @@ -0,0 +1,414 @@ +TEST /// + f = id_(ZZ^5) + v = {1,2,4,3,0} + w = {3,1,2,4,0} + assert(f_(v_w)==(f_v)_w) + assert(f_(v_w)==(f_v)*(f_w)) +/// + +TEST /// + ----------------------------------------------------------------------------- + -- Permutation class + ----------------------------------------------------------------------------- + -- Should expression, string, TeX, and HTML outputs be tested? + + -- valid permutations should be nonempty lists consisting of only all numbers 1..n + assert(isValidPermutation {1}) + assert(isValidPermutation toList (1..8)) + assert(isValidPermutation random toList (1..8)) + assert(not isValidPermutation {}) + assert(not isValidPermutation {0}) + assert(not isValidPermutation toList (0..8)) + assert(not isValidPermutation random toList (0..8)) + assert(not isValidPermutation {1,1,2}) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + expandedIdentity = permutation toList (1..8) + expandedList = toList (1 .. #expandedIdentity) + + -- indexing into a permutation + assert(reducedIdentity_0 == 1) + assert(expandedIdentity_{0..2} == {1,2,3}) + assert(expandedIdentity_{0,2,4,6} == {1,3,5,7}) + assert(expandedIdentity_(0..2) == {1,2,3}) + assert(expandedIdentity_(0,2,4,6) == {1,3,5,7}) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + expandedIdentity = permutation toList (1..8) + expandedList = toList (1 .. #expandedIdentity) + + -- expand and reduce are inverse processes + assert(reduce expandedIdentity == reducedIdentity) + assert(expand(reducedIdentity, #expandedIdentity) == expandedIdentity) + assert(reduce expand(reducedIdentity, #expandedIdentity) == reducedIdentity) + assert(expand(reduce expandedIdentity, #expandedIdentity) == expandedIdentity) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + expandedIdentity = permutation toList (1..8) + expandedList = toList (1 .. #expandedIdentity) + + -- basic operations + -- equality + assert(reducedIdentity == expandedIdentity) + assert(reducedIdentity != permutation reverse expandedList) + assert(expandedIdentity != permutation reverse expandedList) + -- multiplication + assert(reducedIdentity*reducedIdentity == reducedIdentity) + assert(reducedIdentity*expandedIdentity == reducedIdentity) + assert(expandedIdentity*expandedIdentity == reducedIdentity) + assert(expandedIdentity*(permutation switch(0, 1, expandedList)) == permutation switch(0, 1, expandedList)) + assert((permutation switch(0, 1, expandedList))*expandedIdentity == (permutation switch(0, 1, expandedList))) + -- powers + assert(reducedIdentity^2 == reducedIdentity) + assert(reducedIdentity^5 == reducedIdentity) + assert(reducedIdentity^(-1) == reducedIdentity) + assert(reducedIdentity^(-5) == reducedIdentity) + assert(reducedIdentity^0 == reducedIdentity) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + expandedIdentity = permutation toList (1..8) + expandedList = toList (1 .. #expandedIdentity) + + -- matrix representation + assert(toMatrix reducedIdentity == id_(ZZ^1)) + assert(toMatrix expandedIdentity == id_(ZZ^(#expandedIdentity))) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + expandedIdentity = permutation toList (1..8) + expandedList = toList (1 .. #expandedIdentity) + + -- Group actions + assert(reducedIdentity * {1} == {1}) + assert(reducedIdentity * {1,2,3} == {1,2,3}) + assert(reducedIdentity * {3,1,2} == {3,1,2}) + assert(expandedIdentity * toList(1 .. #expandedIdentity) == toList(1 .. #expandedIdentity)) + assert(expandedIdentity * toList(1 .. #expandedIdentity+2) == toList(1 .. #expandedIdentity+2)) + assert(expandedIdentity * switch(0, 1, toList(1 .. #expandedIdentity+2)) == switch(0, 1, toList(1 .. #expandedIdentity+2))) + + assert(reducedIdentity * (toMatrix reducedIdentity) == toMatrix reducedIdentity) + assert(reducedIdentity * (toMatrix expand(reducedIdentity, 3)) == toMatrix expand(reducedIdentity, 3)) + assert(reducedIdentity * (toMatrix permutation {3,1,2}) == toMatrix permutation {3,1,2}) + assert(expandedIdentity * (toMatrix expand(expandedIdentity, #expandedIdentity+2)) == toMatrix expand(expandedIdentity, #expandedIdentity+2)) + assert(expandedIdentity * (toMatrix permutation switch(0, 1, toList(1 .. #expandedIdentity+2))) == toMatrix permutation switch(0, 1, toList(1 .. #expandedIdentity+2))) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + expandedIdentity = permutation toList (1..8) + expandedList = toList (1 .. #expandedIdentity) + + -- cycle decomposition + assert(cycleDecomposition reducedIdentity == {1:1}) + assert(cycleDecomposition expandedIdentity == for i in 1 .. #expandedIdentity list 1:i) + assert(cycleType reducedIdentity == 1:1) + assert(cycleType expandedIdentity == (#expandedIdentity):1) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + expandedIdentity = permutation toList (1..8) + expandedList = toList (1 .. #expandedIdentity) + + -- Ascents, descents, runs, exceedances, and records + assert(ascents reducedIdentity == {}) + assert(ascents expandedIdentity == toList (1 .. #expandedIdentity-1)) + assert(descents reducedIdentity == {}) + assert(descents expandedIdentity == {}) + assert(ascendingRuns reducedIdentity == {1:1}) + assert(ascendingRuns expandedIdentity == {(1 .. #expandedIdentity)}) + assert(descendingRuns reducedIdentity == {1:1}) + assert(descendingRuns expandedIdentity == for i in (1 .. #expandedIdentity) list 1:i) + assert(exceedances reducedIdentity == {}) + assert(exceedances expandedIdentity == {}) + assert(exceedances(reducedIdentity, Weak=>true) == {1}) + assert(exceedances(expandedIdentity, Weak=>true) == expandedList) + assert(saliances reducedIdentity == {last reducedIdentity}) + assert(saliances expandedIdentity == {last expandedIdentity}) + assert(records reducedIdentity == {1}) + assert(records expandedIdentity == expandedList) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + expandedIdentity = permutation toList (1..8) + expandedList = toList (1 .. #expandedIdentity) + + -- pattern avoidance + assert(isVexillary reducedIdentity) + assert(isVexillary expandedIdentity) + assert(isCartwrightSturmfels reducedIdentity) + assert(isCartwrightSturmfels expandedIdentity) + assert(isCDG reducedIdentity) + assert(isCDG expandedIdentity) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + expandedIdentity = permutation toList (1..8) + expandedList = toList (1 .. #expandedIdentity) + + -- Foata's fundamental bijection + assert(foataBijection reducedIdentity == reducedIdentity) + assert(foataBijection expandedIdentity == expandedIdentity) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + expandedIdentity = permutation toList (1..8) + expandedList = toList (1 .. #expandedIdentity) + + -- miscellaneous + assert(inverse reducedIdentity == reducedIdentity) + assert(inverse expandedIdentity == expandedIdentity) + assert(ord reducedIdentity == 1) + assert(ord expandedIdentity == 1) + assert(sign reducedIdentity == 1) + assert(sign expandedIdentity == 1) + assert(isEven reducedIdentity) + assert(isEven expandedIdentity) + assert(not isOdd reducedIdentity) + assert(not isOdd expandedIdentity) + assert(not isDerangement reducedIdentity) + assert(not isDerangement expandedIdentity) + assert(fixedPoints reducedIdentity == {1}) + assert(fixedPoints expandedIdentity == expandedList) + assert(inversions reducedIdentity == {}) + assert(inversions expandedIdentity == {}) +/// + +TEST /// + ----------------------- + -- longest permutation + ----------------------- + p = permutation reverse toList (1..10) + pList = toList p + expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + + -- indexing into a permutation + assert(p_1 == 10) + assert(p_{0..2} == {10,9,8}) + assert(p_{0,2,4,6,8} == {10,8,6,4,2}) + assert(p_(0..2) == {10,9,8}) + assert(p_(0,2,4,6,8) == {10,8,6,4,2}) +/// + +TEST /// + ----------------------- + -- longest permutation + ----------------------- + p = permutation reverse toList (1..10) + pList = toList p + expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + + -- expand and reduce are inverse processes + assert(reduce p == p) + assert(expand(p, #p+2) == expandedP) + assert(reduce expand(p, #p+2) == p) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + + ----------------------- + -- longest permutation + ----------------------- + p = permutation reverse toList (1..10) + pList = toList p + expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + + -- basic operations + -- equality + assert(p == expandedP) + -- assert(reducedIdentity != permutation reverse expandedList) + assert(reducedIdentity != reverse expandedP) + -- multiplication + assert(reducedIdentity*reducedIdentity == reducedIdentity) + -- powers + assert(p^2 == reducedIdentity) + assert(p^5 == p) + assert(p^(-1) == p) + assert(p^(-5) == p) + assert(p^0 == reducedIdentity) +/// + +TEST /// + ----------------------- + -- longest permutation + ----------------------- + p = permutation reverse toList (1..10) + pList = toList p + expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + + -- matrix representation + antiDiagIdentity = matrix for i in (0 ..< #p) list for j in (0 ..< #p) list if i+j == #p-1 then 1 else 0 + assert(toMatrix p == antiDiagIdentity) +/// + +TEST /// + ----------------------- + -- longest permutation + ----------------------- + p = permutation reverse toList (1..10) + pList = toList p + expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + + -- Group actions + assert(p * toList(1 .. #p) == pList) + assert(p * toList(1 .. #p+2) == toList expandedP) + assert(p * {5,4,3,2,1,10,9,8,7,6} == {6,7,8,9,10,1,2,3,4,5}) + + assert(p * (toMatrix p) == id_(ZZ^#p)) + assert(p * (toMatrix permutation {6,7,8,9,10,1,2,3,4,5}) == matrix {{0,0,0,0,1,0,0,0,0,0}, + {0,0,0,1,0,0,0,0,0,0}, + {0,0,1,0,0,0,0,0,0,0}, + {0,1,0,0,0,0,0,0,0,0}, + {1,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,1}, + {0,0,0,0,0,0,0,0,1,0}, + {0,0,0,0,0,0,0,1,0,0}, + {0,0,0,0,0,0,1,0,0,0}, + {0,0,0,0,0,1,0,0,0,0}}) +/// + +TEST /// + ----------------------- + -- longest permutation + ----------------------- + p = permutation reverse toList (1..10) + pList = toList p + expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + + -- cycle decomposition + assert(cycleDecomposition p == {(6,5), (7,4), (8,3), (9,2), (10,1)}) + assert(cycleType p == (2,2,2,2,2)) +/// + +TEST /// + ----------------------- + -- longest permutation + ----------------------- + p = permutation reverse toList (1..10) + pList = toList p + expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + + -- Ascents, descents, runs, exceedances, and records + assert(ascents p == {}) + assert(descents p == {1,2,3,4,5,6,7,8,9}) + assert(ascendingRuns p == for i in reverse (1 .. #p) list 1:i) + assert(descendingRuns p == {reverse (1 .. #p)}) + assert(exceedances p == {1,2,3,4,5}) + assert(exceedances(p, Weak=>true) == {1,2,3,4,5}) + assert(saliances p == toList(1 .. #p)) + assert(records p == {1}) +/// + +TEST /// + ----------------------- + -- longest permutation + ----------------------- + p = permutation reverse toList (1..10) + pList = toList p + expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + + -- pattern avoidance + assert(isVexillary p) + assert(isCartwrightSturmfels p) + assert(isCDG p) +/// + +TEST /// + ----------------------- + -- longest permutation + ----------------------- + p = permutation reverse toList (1..10) + pList = toList p + expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + + -- Foata's fundamental bijection + assert(foataBijection p == permutation {6,5,7,4,8,3,9,2,10,1}) +/// + +TEST /// + ----------------------- + -- longest permutation + ----------------------- + p = permutation reverse toList (1..10) + pList = toList p + expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + + -- miscellaneous + assert(inverse p == p) + assert(ord p == 2) + assert(sign p == -1) + assert(not isEven p) + assert(isOdd p) + assert(isDerangement p) + assert(fixedPoints p == {}) + assert(sort inversions p == sort subsets(1 .. #p, 2)) +/// + +TEST /// + ----------------------- + -- identity permutation + ----------------------- + reducedIdentity = permutation {1} + + ------- + -- Misc + ------- + p = permutation random toList (1..10) + assert((inverse p)*p == reducedIdentity) + assert(p*(inverse p) == reducedIdentity) + assert(ord p == ord inverse p) + assert(cycleType p == cycleType inverse p) + assert(sign p == sign inverse p) + + -- some more pattern avoidance + assert(not avoidsPattern(permutation {2,3,7,1,5,8,4,6}, {1,4,3,2})) + assert(avoidsPattern(permutation {1,4,6,2,3,7,5}, {1,4,3,2})) + assert(not isVexillary(permutation {7,2,5,8,1,3,6,4})) + assert(isVexillary(permutation {1,6,9,2,4,7,3,5,8})) +/// \ No newline at end of file diff --git a/M2/Macaulay2/tests/normal/permutations.m2 b/M2/Macaulay2/tests/normal/permutations.m2 deleted file mode 100644 index c51aa0282ce..00000000000 --- a/M2/Macaulay2/tests/normal/permutations.m2 +++ /dev/null @@ -1,232 +0,0 @@ -f = id_(ZZ^5) -v = {1,2,4,3,0} -w = {3,1,2,4,0} -assert(f_(v_w)==(f_v)_w) -assert(f_(v_w)==(f_v)*(f_w)) - ------------------------------------------------------------------------------ --- Permutation class ------------------------------------------------------------------------------ --- Should expression, string, TeX, and HTML outputs be tested? - --- valid permutations should be nonempty lists consisting of only all numbers 1..n -assert(isValidPermutation {1}) -assert(isValidPermutation toList (1..8)) -assert(isValidPermutation random toList (1..8)) -assert(not isValidPermutation {}) -assert(not isValidPermutation {0}) -assert(not isValidPermutation toList (0..8)) -assert(not isValidPermutation random toList (0..8)) -assert(not isValidPermutation {1,1,2}) - ------------------------ --- identity permutation ------------------------ -reducedIdentity = permutation {1} -expandedIdentity = permutation toList (1..8) -expandedList = toList (1 .. #expandedIdentity) - --- indexing into a permutation -assert(reducedIdentity_0 == 1) -assert(expandedIdentity_{0..2} == {1,2,3}) -assert(expandedIdentity_{0,2,4,6} == {1,3,5,7}) -assert(expandedIdentity_(0..2) == {1,2,3}) -assert(expandedIdentity_(0,2,4,6) == {1,3,5,7}) - --- expand and reduce are inverse processes -assert(reduce expandedIdentity == reducedIdentity) -assert(expand(reducedIdentity, #expandedIdentity) == expandedIdentity) -assert(reduce expand(reducedIdentity, #expandedIdentity) == reducedIdentity) -assert(expand(reduce expandedIdentity, #expandedIdentity) == expandedIdentity) - --- basic operations --- equality -assert(reducedIdentity == expandedIdentity) -assert(reducedIdentity != permutation reverse expandedList) -assert(expandedIdentity != permutation reverse expandedList) --- multiplication -assert(reducedIdentity*reducedIdentity == reducedIdentity) -assert(reducedIdentity*expandedIdentity == reducedIdentity) -assert(expandedIdentity*expandedIdentity == reducedIdentity) -assert(expandedIdentity*(permutation switch(0, 1, expandedList)) == permutation switch(0, 1, expandedList)) -assert((permutation switch(0, 1, expandedList))*expandedIdentity == (permutation switch(0, 1, expandedList))) --- powers -assert(reducedIdentity^2 == reducedIdentity) -assert(reducedIdentity^5 == reducedIdentity) -assert(reducedIdentity^(-1) == reducedIdentity) -assert(reducedIdentity^(-5) == reducedIdentity) -assert(reducedIdentity^0 == reducedIdentity) - --- matrix representation -assert(toMatrix reducedIdentity == id_(ZZ^1)) -assert(toMatrix expandedIdentity == id_(ZZ^(#expandedIdentity))) - --- Group actions -assert(reducedIdentity * {1} == {1}) -assert(reducedIdentity * {1,2,3} == {1,2,3}) -assert(reducedIdentity * {3,1,2} == {3,1,2}) -assert(expandedIdentity * toList(1 .. #expandedIdentity) == toList(1 .. #expandedIdentity)) -assert(expandedIdentity * toList(1 .. #expandedIdentity+2) == toList(1 .. #expandedIdentity+2)) -assert(expandedIdentity * switch(0, 1, toList(1 .. #expandedIdentity+2)) == switch(0, 1, toList(1 .. #expandedIdentity+2))) - -assert(reducedIdentity * (toMatrix reducedIdentity) == toMatrix reducedIdentity) -assert(reducedIdentity * (toMatrix expand(reducedIdentity, 3)) == toMatrix expand(reducedIdentity, 3)) -assert(reducedIdentity * (toMatrix permutation {3,1,2}) == toMatrix permutation {3,1,2}) -assert(expandedIdentity * (toMatrix expand(expandedIdentity, #expandedIdentity+2)) == toMatrix expand(expandedIdentity, #expandedIdentity+2)) -assert(expandedIdentity * (toMatrix permutation switch(0, 1, toList(1 .. #expandedIdentity+2))) == toMatrix permutation switch(0, 1, toList(1 .. #expandedIdentity+2))) - --- cycle decomposition -assert(cycleDecomposition reducedIdentity == {1:1}) -assert(cycleDecomposition expandedIdentity == for i in 1 .. #expandedIdentity list 1:i) -assert(cycleType reducedIdentity == 1:1) -assert(cycleType expandedIdentity == (#expandedIdentity):1) - --- Ascents, descents, runs, exceedances, and records -assert(ascents reducedIdentity == {}) -assert(ascents expandedIdentity == toList (1 .. #expandedIdentity-1)) -assert(descents reducedIdentity == {}) -assert(descents expandedIdentity == {}) -assert(ascendingRuns reducedIdentity == {1:1}) -assert(ascendingRuns expandedIdentity == {(1 .. #expandedIdentity)}) -assert(descendingRuns reducedIdentity == {1:1}) -assert(descendingRuns expandedIdentity == for i in (1 .. #expandedIdentity) list 1:i) -assert(exceedances reducedIdentity == {}) -assert(exceedances expandedIdentity == {}) -assert(exceedances(reducedIdentity, Weak=>true) == {1}) -assert(exceedances(expandedIdentity, Weak=>true) == expandedList) -assert(saliances reducedIdentity == {last reducedIdentity}) -assert(saliances expandedIdentity == {last expandedIdentity}) -assert(records reducedIdentity == {1}) -assert(records expandedIdentity == expandedList) - --- pattern avoidance -assert(isVexillary reducedIdentity) -assert(isVexillary expandedIdentity) -assert(isCartwrightSturmfels reducedIdentity) -assert(isCartwrightSturmfels expandedIdentity) -assert(isCDG reducedIdentity) -assert(isCDG expandedIdentity) - --- Foata's fundamental bijection -assert(foataBijection reducedIdentity == reducedIdentity) -assert(foataBijection expandedIdentity == expandedIdentity) - --- miscellaneous -assert(inverse reducedIdentity == reducedIdentity) -assert(inverse expandedIdentity == expandedIdentity) -assert(ord reducedIdentity == 1) -assert(ord expandedIdentity == 1) -assert(sign reducedIdentity == 1) -assert(sign expandedIdentity == 1) -assert(isEven reducedIdentity) -assert(isEven expandedIdentity) -assert(not isOdd reducedIdentity) -assert(not isOdd expandedIdentity) -assert(not isDerangement reducedIdentity) -assert(not isDerangement expandedIdentity) -assert(fixedPoints reducedIdentity == {1}) -assert(fixedPoints expandedIdentity == expandedList) -assert(inversions reducedIdentity == {}) -assert(inversions expandedIdentity == {}) - ------------------------ --- longest permutation ------------------------ -p = permutation reverse toList (1..10) -pList = toList p -expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) - --- indexing into a permutation -assert(p_0 == 10) -assert(p_{0..2} == {10,9,8}) -assert(p_{0,2,4,6,8} == {10,8,6,4,2}) -assert(p_(0..2) == {10,9,8}) -assert(p_(0,2,4,6,8) == {10,8,6,4,2}) - --- expand and reduce are inverse processes -assert(reduce p == p) -assert(expand(p, #p+2) == expandedP) -assert(reduce expand(p, #p+2) == p) - --- basic operations --- equality -assert(p == expandedP) -assert(reducedIdentity != permutation reverse expandedList) --- multiplication -assert(reducedIdentity*reducedIdentity == reducedIdentity) --- powers -assert(p^2 == reducedIdentity) -assert(p^5 == p) -assert(p^(-1) == p) -assert(p^(-5) == p) -assert(p^0 == reducedIdentity) - --- matrix representation -antiDiagIdentity = matrix for i in (0 ..< #p) list for j in (0 ..< #p) list if i+j == #p-1 then 1 else 0 -assert(toMatrix p == antiDiagIdentity) - --- Group actions -assert(p * toList(1 .. #p) == pList) -assert(p * toList(1 .. #p+2) == toList expandedP) -assert(p * {5,4,3,2,1,10,9,8,7,6} == {6,7,8,9,10,1,2,3,4,5}) - -assert(p * (toMatrix p) == id_(ZZ^#p)) -assert(p * (toMatrix permutation {6,7,8,9,10,1,2,3,4,5}) == matrix {{0,0,0,0,1,0,0,0,0,0}, - {0,0,0,1,0,0,0,0,0,0}, - {0,0,1,0,0,0,0,0,0,0}, - {0,1,0,0,0,0,0,0,0,0}, - {1,0,0,0,0,0,0,0,0,0}, - {0,0,0,0,0,0,0,0,0,1}, - {0,0,0,0,0,0,0,0,1,0}, - {0,0,0,0,0,0,0,1,0,0}, - {0,0,0,0,0,0,1,0,0,0}, - {0,0,0,0,0,1,0,0,0,0}}) - --- cycle decomposition -assert(cycleDecomposition p == {(6,5), (7,4), (8,3), (9,2), (10,1)}) -assert(cycleType p == (2,2,2,2,2)) - --- Ascents, descents, runs, exceedances, and records -assert(ascents p == {}) -assert(descents p == {1,2,3,4,5,6,7,8,9}) -assert(ascendingRuns p == for i in reverse (1 .. #p) list 1:i) -assert(descendingRuns p == {reverse (1 .. #p)}) -assert(exceedances p == {1,2,3,4,5}) -assert(exceedances(p, Weak=>true) == {1,2,3,4,5}) -assert(saliances p == toList(1 .. #p)) -assert(records p == {1}) - --- pattern avoidance -assert(isVexillary p) -assert(isCartwrightSturmfels p) -assert(isCDG p) - --- Foata's fundamental bijection -assert(foataBijection p == permutation {6,5,7,4,8,3,9,2,10,1}) - --- miscellaneous -assert(inverse p == p) -assert(ord p == 2) -assert(sign p == -1) -assert(not isEven p) -assert(isOdd p) -assert(isDerangement p) -assert(fixedPoints p == {}) -assert(sort inversions p == sort subsets(1 .. #p, 2)) - - -------- --- Misc -------- -p = permutation random toList (1..10) -assert((inverse p)*p == reducedIdentity) -assert(p*(inverse p) == reducedIdentity) -assert(ord p == ord inverse p) -assert(cycleType p == cycleType inverse p) -assert(sign p == sign inverse p) - --- some more pattern avoidance -assert(not avoidsPattern(permutation {2,3,7,1,5,8,4,6}, {1,4,3,2})) -assert(avoidsPattern(permutation {1,4,6,2,3,7,5}, {1,4,3,2})) -assert(not isVexillary(permutation {7,2,5,8,1,3,6,4})) -assert(isVexillary(permutation {1,6,9,2,4,7,3,5,8})) From 6fb271ddbc9f3fa0089a05b9bb1f0f9457837a6a Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Wed, 31 Jul 2024 21:39:32 -0500 Subject: [PATCH 003/226] Corrected pattern avoidance, reduce/expand changed, new length method --- .../packages/Permutations/Permutations.m2 | 44 ++- .../packages/Permutations/PermutationsDOC.m2 | 70 +++-- .../Permutations/PermutationsTests.m2 | 286 +++++++++--------- 3 files changed, 217 insertions(+), 183 deletions(-) diff --git a/M2/Macaulay2/packages/Permutations/Permutations.m2 b/M2/Macaulay2/packages/Permutations/Permutations.m2 index 93d1bf5670e..571257215bd 100644 --- a/M2/Macaulay2/packages/Permutations/Permutations.m2 +++ b/M2/Macaulay2/packages/Permutations/Permutations.m2 @@ -43,34 +43,30 @@ Permutation _ Sequence := List => (w,s) -> ((toList w)_(toList s)) ----------------------------------------------------------------------------- -- Change which symmetric group S_n to view a permutation as an element of ----------------------------------------------------------------------------- --- it would be nice if this method was called "trim", but that is a protected global variable -reduce = method(TypicalValue => Permutation) -reduce Permutation := Permutation => w -> ( +trim Permutation := Permutation => o -> w -> ( w = w_(select(#w, i -> w_{i ..< #w} != toList(i+1 .. #w))); if #w == 0 then permutation {1} else permutation w ) --- it would be nice if this method was called "extend", but that is a protected global variable -expand = method(TypicalValue => Permutation) -expand (Permutation, ZZ) := Permutation => (w,n) -> ( +extend (Permutation, ZZ) := Permutation => o -> (w,n) -> ( if n < #w then error(toString w | " is a permutation on more than " | toString n | " letters."); permutation(toList(w) | toList(#w+1..n)) ) -expand (Permutation, Permutation) := Sequence => (w,v) -> ( +extend (Permutation, Permutation) := Sequence => o -> (w,v) -> ( n := max(#w, #v); - (expand(w,n), expand(v,n)) + (extend(w,n), extend(v,n)) ) ----------------------------------------------------------------------------- -- Basic permutation operations ----------------------------------------------------------------------------- Permutation == Permutation := Boolean => (w, v) -> ( - (w, v) = expand(w,v); + (w, v) = extend(w,v); toList(w) == toList(v) ) Permutation * Permutation := Permutation => (w, v) -> ( - (w,v) = expand(w,v); - reduce permutation w_(to0Index toList v) + (w,v) = extend(w,v); + trim permutation w_(to0Index toList v) ) -- power implementation modified from Mahrud's in https://github.com/Macaulay2/M2/issues/2581 Permutation ^ ZZ := Permutation => (w, n) -> fold(if n < 0 then (-n):(permutation to1Index inversePermutation to0Index toList w) else n:w, @@ -90,15 +86,15 @@ toMatrix Permutation := Matrix => w -> ( -- Group actions ----------------------------------------------------------------------------- Permutation * List := List => (w, l) -> ( - if #(reduce w) > #l then error(toString w | " permutes more than " | toString #l | " elements.") - else l_(to0Index toList expand(w, #l)) + if #(trim w) > #l then error(toString w | " permutes more than " | toString #l | " elements.") + else l_(to0Index toList extend(w, #l)) ) -- group action on a matrix permutes the ROWS of the matrix -- maybe would prefer to permute the columns? Seems more natural Permutation * Matrix := Matrix => (w, M) -> ( m := numRows M; - if #(reduce w) > m then error(toString w | " permutes more than " | toString m | " elements.") - else (toMatrix expand(w, m)) * M + if #(trim w) > m then error(toString w | " permutes more than " | toString m | " elements.") + else (toMatrix extend(w, m)) * M ) ----------------------------------------------------------------------------- @@ -212,14 +208,14 @@ records Permutation := List => w -> ( avoidsPattern = method(TypicalValue => Boolean) avoidsPattern (Permutation,List) := Boolean => (w, pattern) -> ( --assume permutation is pattern-avoiding, break if not true - isAvoiding := true; - for idx in subsets(0 ..< #w, #pattern) do ( - sortedIdx := sort(idx); - pairwiseComparison := apply(pattern_{0..#pattern-2}, pattern_{1..#pattern-1}, (i,j) -> w#(sortedIdx#(i-1)) < w#(sortedIdx#(j-1))); -- pairwise comparison of permutation according to pattern - isAvoiding = not all(pairwiseComparison, i -> i == true); -- true if there was one inequality that failed, else all inequalities are true and so not pattern-avoiding - if not isAvoiding then break; - ); - isAvoiding + for idx in subsets(0 .. #w-1, #pattern) do { + vals := w_(idx); + sortedVals := sort(vals); + relPositions := hashTable toList apply(0..#vals-1, i -> {sortedVals#i, i}); + p := toList apply(vals, i -> (relPositions#i) + 1); + if p == pattern then return false; + }; + true ) avoidsPatterns = method(TypicalValue => Boolean) @@ -311,3 +307,5 @@ inversions = method(TypicalValue => List) inversions Permutation := List => w -> ( for idxPair in sort(subsets(toList w, 2) / sort) list if w_(idxPair#0) > w_(idxPair#1) then idxPair else continue ) + +length Permutation := ZZ => w -> (#(inversions w)) diff --git a/M2/Macaulay2/packages/Permutations/PermutationsDOC.m2 b/M2/Macaulay2/packages/Permutations/PermutationsDOC.m2 index 2b82f4df958..576b3b4bbf8 100644 --- a/M2/Macaulay2/packages/Permutations/PermutationsDOC.m2 +++ b/M2/Macaulay2/packages/Permutations/PermutationsDOC.m2 @@ -283,7 +283,7 @@ doc /// descendingRuns descents exceedances - expand + extend fixedPoints foataBijection inverse @@ -297,7 +297,7 @@ doc /// isVexillary ord records - reduce + trim saliances sign toMatrix @@ -786,15 +786,15 @@ doc /// records /// --- expand(w,n) +-- extend(w,n) doc /// Key - expand - (expand, Permutation, ZZ) + extend + (extend, Permutation, ZZ) Headline rewrites a permutation as a permution on more symbols Usage - expand(w,n) + extend(w,n) Inputs w:Permutation n:ZZ @@ -807,20 +807,20 @@ doc /// on $N > n$ symbols as well by fixing the $(n+1)$st through $N$th symbols. Example p = permutation {3,1,2,5,4} - expand(p, 7) + extend(p, 7) SeeAlso - reduce + trim /// --- expand(w,v) +-- extend(w,v) -- TODO: how to write documentation for tuple output doc /// Key - (expand, Permutation, Permutation) + (extend, Permutation, Permutation) Headline rewrites two permutations to be permutations on the same number of symbols Usage - e = expand(w,v) + e = extend(w,v) Inputs w:Permutation v:Permutation @@ -828,18 +828,18 @@ Outputs e:Sequence Description Text - For ease, we can also expand two permutations so that they are regarded as + For ease, we can also extend two permutations so that they are regarded as permutations on the same number of symbols. More precisely, if we have permutations $p=(p_1, \hdots, p_n)$ and $q=(q_1, \hdots, q_m)$, then - {\tt expand(p,q)} will return both $p$ and $q$ as permutations on + {\tt extend(p,q)} will return both $p$ and $q$ as permutations on $\text{max}(m,n)$ symbols. Example p = permutation {3,1,2,5,4} q = permutation {2,3,1,4,5,7,6} - expand(p,q) + extend(p,q) SeeAlso - (expand, Permutation, ZZ) - reduce + (extend, Permutation, ZZ) + trim /// @@ -930,6 +930,8 @@ doc /// Example p = permutation {3,1,2,5,4} inversions p + SeeAlso + length /// -- isCartwrightSturmfels @@ -1114,6 +1116,28 @@ doc /// isCDG /// +-- length +doc /// + Key + (length, Permutation) + Headline + computes the length of a permutation + Usage + length w + Inputs + w:Permutation + Outputs + :ZZ + Description + Text + The {\emph length} of a permutation is the size of its inversion set. + Example + p = permutation {3,1,2,5,4} + length p + SeeAlso + inversions +/// + -- ord doc /// Key @@ -1165,30 +1189,30 @@ doc /// saliances /// --- reduce +-- trim doc /// Key - reduce - (reduce, Permutation) + trim + (trim, Permutation) Headline rewrites a permutation in its smallest representation Usage - reduce w + trim w Inputs w:Permutation Outputs :Permutation Description Text - {\tt reduce} rewrites a permutation $p$ as a permutation in $S_n$, + {\tt trim} rewrites a permutation $p$ as a permutation in $S_n$, where $n$ is the smallest integer such that $p$ is in $\mathfrak{S}_n$. In other words, it returns a permutation where any extraneous fixed points are removed. Example p = permutation {3,1,2,5,4,6,7} - reduce p + trim p SeeAlso - expand + extend /// -- saliances diff --git a/M2/Macaulay2/packages/Permutations/PermutationsTests.m2 b/M2/Macaulay2/packages/Permutations/PermutationsTests.m2 index f9e8eeb194a..cf72aaeefe8 100644 --- a/M2/Macaulay2/packages/Permutations/PermutationsTests.m2 +++ b/M2/Macaulay2/packages/Permutations/PermutationsTests.m2 @@ -27,193 +27,195 @@ TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} - expandedIdentity = permutation toList (1..8) - expandedList = toList (1 .. #expandedIdentity) + trimmedIdentity = permutation {1} + extendedIdentity = permutation toList (1..8) + extendedList = toList (1 .. #extendedIdentity) -- indexing into a permutation - assert(reducedIdentity_0 == 1) - assert(expandedIdentity_{0..2} == {1,2,3}) - assert(expandedIdentity_{0,2,4,6} == {1,3,5,7}) - assert(expandedIdentity_(0..2) == {1,2,3}) - assert(expandedIdentity_(0,2,4,6) == {1,3,5,7}) + assert(trimmedIdentity_0 == 1) + assert(extendedIdentity_{0..2} == {1,2,3}) + assert(extendedIdentity_{0,2,4,6} == {1,3,5,7}) + assert(extendedIdentity_(0..2) == {1,2,3}) + assert(extendedIdentity_(0,2,4,6) == {1,3,5,7}) /// TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} - expandedIdentity = permutation toList (1..8) - expandedList = toList (1 .. #expandedIdentity) + trimmedIdentity = permutation {1} + extendedIdentity = permutation toList (1..8) + extendedList = toList (1 .. #extendedIdentity) - -- expand and reduce are inverse processes - assert(reduce expandedIdentity == reducedIdentity) - assert(expand(reducedIdentity, #expandedIdentity) == expandedIdentity) - assert(reduce expand(reducedIdentity, #expandedIdentity) == reducedIdentity) - assert(expand(reduce expandedIdentity, #expandedIdentity) == expandedIdentity) + -- extend and trim are inverse processes + assert(trim extendedIdentity == trimmedIdentity) + assert(extend(trimmedIdentity, #extendedIdentity) == extendedIdentity) + assert(trim extend(trimmedIdentity, #extendedIdentity) == trimmedIdentity) + assert(extend(trim extendedIdentity, #extendedIdentity) == extendedIdentity) /// TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} - expandedIdentity = permutation toList (1..8) - expandedList = toList (1 .. #expandedIdentity) + trimmedIdentity = permutation {1} + extendedIdentity = permutation toList (1..8) + extendedList = toList (1 .. #extendedIdentity) -- basic operations -- equality - assert(reducedIdentity == expandedIdentity) - assert(reducedIdentity != permutation reverse expandedList) - assert(expandedIdentity != permutation reverse expandedList) + assert(trimmedIdentity == extendedIdentity) + assert(trimmedIdentity != permutation reverse extendedList) + assert(extendedIdentity != permutation reverse extendedList) -- multiplication - assert(reducedIdentity*reducedIdentity == reducedIdentity) - assert(reducedIdentity*expandedIdentity == reducedIdentity) - assert(expandedIdentity*expandedIdentity == reducedIdentity) - assert(expandedIdentity*(permutation switch(0, 1, expandedList)) == permutation switch(0, 1, expandedList)) - assert((permutation switch(0, 1, expandedList))*expandedIdentity == (permutation switch(0, 1, expandedList))) + assert(trimmedIdentity*trimmedIdentity == trimmedIdentity) + assert(trimmedIdentity*extendedIdentity == trimmedIdentity) + assert(extendedIdentity*extendedIdentity == trimmedIdentity) + assert(extendedIdentity*(permutation switch(0, 1, extendedList)) == permutation switch(0, 1, extendedList)) + assert((permutation switch(0, 1, extendedList))*extendedIdentity == (permutation switch(0, 1, extendedList))) -- powers - assert(reducedIdentity^2 == reducedIdentity) - assert(reducedIdentity^5 == reducedIdentity) - assert(reducedIdentity^(-1) == reducedIdentity) - assert(reducedIdentity^(-5) == reducedIdentity) - assert(reducedIdentity^0 == reducedIdentity) + assert(trimmedIdentity^2 == trimmedIdentity) + assert(trimmedIdentity^5 == trimmedIdentity) + assert(trimmedIdentity^(-1) == trimmedIdentity) + assert(trimmedIdentity^(-5) == trimmedIdentity) + assert(trimmedIdentity^0 == trimmedIdentity) /// TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} - expandedIdentity = permutation toList (1..8) - expandedList = toList (1 .. #expandedIdentity) + trimmedIdentity = permutation {1} + extendedIdentity = permutation toList (1..8) + extendedList = toList (1 .. #extendedIdentity) -- matrix representation - assert(toMatrix reducedIdentity == id_(ZZ^1)) - assert(toMatrix expandedIdentity == id_(ZZ^(#expandedIdentity))) + assert(toMatrix trimmedIdentity == id_(ZZ^1)) + assert(toMatrix extendedIdentity == id_(ZZ^(#extendedIdentity))) /// TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} - expandedIdentity = permutation toList (1..8) - expandedList = toList (1 .. #expandedIdentity) + trimmedIdentity = permutation {1} + extendedIdentity = permutation toList (1..8) + extendedList = toList (1 .. #extendedIdentity) -- Group actions - assert(reducedIdentity * {1} == {1}) - assert(reducedIdentity * {1,2,3} == {1,2,3}) - assert(reducedIdentity * {3,1,2} == {3,1,2}) - assert(expandedIdentity * toList(1 .. #expandedIdentity) == toList(1 .. #expandedIdentity)) - assert(expandedIdentity * toList(1 .. #expandedIdentity+2) == toList(1 .. #expandedIdentity+2)) - assert(expandedIdentity * switch(0, 1, toList(1 .. #expandedIdentity+2)) == switch(0, 1, toList(1 .. #expandedIdentity+2))) - - assert(reducedIdentity * (toMatrix reducedIdentity) == toMatrix reducedIdentity) - assert(reducedIdentity * (toMatrix expand(reducedIdentity, 3)) == toMatrix expand(reducedIdentity, 3)) - assert(reducedIdentity * (toMatrix permutation {3,1,2}) == toMatrix permutation {3,1,2}) - assert(expandedIdentity * (toMatrix expand(expandedIdentity, #expandedIdentity+2)) == toMatrix expand(expandedIdentity, #expandedIdentity+2)) - assert(expandedIdentity * (toMatrix permutation switch(0, 1, toList(1 .. #expandedIdentity+2))) == toMatrix permutation switch(0, 1, toList(1 .. #expandedIdentity+2))) + assert(trimmedIdentity * {1} == {1}) + assert(trimmedIdentity * {1,2,3} == {1,2,3}) + assert(trimmedIdentity * {3,1,2} == {3,1,2}) + assert(extendedIdentity * toList(1 .. #extendedIdentity) == toList(1 .. #extendedIdentity)) + assert(extendedIdentity * toList(1 .. #extendedIdentity+2) == toList(1 .. #extendedIdentity+2)) + assert(extendedIdentity * switch(0, 1, toList(1 .. #extendedIdentity+2)) == switch(0, 1, toList(1 .. #extendedIdentity+2))) + + assert(trimmedIdentity * (toMatrix trimmedIdentity) == toMatrix trimmedIdentity) + assert(trimmedIdentity * (toMatrix extend(trimmedIdentity, 3)) == toMatrix extend(trimmedIdentity, 3)) + assert(trimmedIdentity * (toMatrix permutation {3,1,2}) == toMatrix permutation {3,1,2}) + assert(extendedIdentity * (toMatrix extend(extendedIdentity, #extendedIdentity+2)) == toMatrix extend(extendedIdentity, #extendedIdentity+2)) + assert(extendedIdentity * (toMatrix permutation switch(0, 1, toList(1 .. #extendedIdentity+2))) == toMatrix permutation switch(0, 1, toList(1 .. #extendedIdentity+2))) /// TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} - expandedIdentity = permutation toList (1..8) - expandedList = toList (1 .. #expandedIdentity) + trimmedIdentity = permutation {1} + extendedIdentity = permutation toList (1..8) + extendedList = toList (1 .. #extendedIdentity) -- cycle decomposition - assert(cycleDecomposition reducedIdentity == {1:1}) - assert(cycleDecomposition expandedIdentity == for i in 1 .. #expandedIdentity list 1:i) - assert(cycleType reducedIdentity == 1:1) - assert(cycleType expandedIdentity == (#expandedIdentity):1) + assert(cycleDecomposition trimmedIdentity == {1:1}) + assert(cycleDecomposition extendedIdentity == for i in 1 .. #extendedIdentity list 1:i) + assert(cycleType trimmedIdentity == 1:1) + assert(cycleType extendedIdentity == (#extendedIdentity):1) /// TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} - expandedIdentity = permutation toList (1..8) - expandedList = toList (1 .. #expandedIdentity) + trimmedIdentity = permutation {1} + extendedIdentity = permutation toList (1..8) + extendedList = toList (1 .. #extendedIdentity) -- Ascents, descents, runs, exceedances, and records - assert(ascents reducedIdentity == {}) - assert(ascents expandedIdentity == toList (1 .. #expandedIdentity-1)) - assert(descents reducedIdentity == {}) - assert(descents expandedIdentity == {}) - assert(ascendingRuns reducedIdentity == {1:1}) - assert(ascendingRuns expandedIdentity == {(1 .. #expandedIdentity)}) - assert(descendingRuns reducedIdentity == {1:1}) - assert(descendingRuns expandedIdentity == for i in (1 .. #expandedIdentity) list 1:i) - assert(exceedances reducedIdentity == {}) - assert(exceedances expandedIdentity == {}) - assert(exceedances(reducedIdentity, Weak=>true) == {1}) - assert(exceedances(expandedIdentity, Weak=>true) == expandedList) - assert(saliances reducedIdentity == {last reducedIdentity}) - assert(saliances expandedIdentity == {last expandedIdentity}) - assert(records reducedIdentity == {1}) - assert(records expandedIdentity == expandedList) + assert(ascents trimmedIdentity == {}) + assert(ascents extendedIdentity == toList (1 .. #extendedIdentity-1)) + assert(descents trimmedIdentity == {}) + assert(descents extendedIdentity == {}) + assert(ascendingRuns trimmedIdentity == {1:1}) + assert(ascendingRuns extendedIdentity == {(1 .. #extendedIdentity)}) + assert(descendingRuns trimmedIdentity == {1:1}) + assert(descendingRuns extendedIdentity == for i in (1 .. #extendedIdentity) list 1:i) + assert(exceedances trimmedIdentity == {}) + assert(exceedances extendedIdentity == {}) + assert(exceedances(trimmedIdentity, Weak=>true) == {1}) + assert(exceedances(extendedIdentity, Weak=>true) == extendedList) + assert(saliances trimmedIdentity == {last trimmedIdentity}) + assert(saliances extendedIdentity == {last extendedIdentity}) + assert(records trimmedIdentity == {1}) + assert(records extendedIdentity == extendedList) /// TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} - expandedIdentity = permutation toList (1..8) - expandedList = toList (1 .. #expandedIdentity) + trimmedIdentity = permutation {1} + extendedIdentity = permutation toList (1..8) + extendedList = toList (1 .. #extendedIdentity) -- pattern avoidance - assert(isVexillary reducedIdentity) - assert(isVexillary expandedIdentity) - assert(isCartwrightSturmfels reducedIdentity) - assert(isCartwrightSturmfels expandedIdentity) - assert(isCDG reducedIdentity) - assert(isCDG expandedIdentity) + assert(isVexillary trimmedIdentity) + assert(isVexillary extendedIdentity) + assert(isCartwrightSturmfels trimmedIdentity) + assert(isCartwrightSturmfels extendedIdentity) + assert(isCDG trimmedIdentity) + assert(isCDG extendedIdentity) /// TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} - expandedIdentity = permutation toList (1..8) - expandedList = toList (1 .. #expandedIdentity) + trimmedIdentity = permutation {1} + extendedIdentity = permutation toList (1..8) + extendedList = toList (1 .. #extendedIdentity) -- Foata's fundamental bijection - assert(foataBijection reducedIdentity == reducedIdentity) - assert(foataBijection expandedIdentity == expandedIdentity) + assert(foataBijection trimmedIdentity == trimmedIdentity) + assert(foataBijection extendedIdentity == extendedIdentity) /// TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} - expandedIdentity = permutation toList (1..8) - expandedList = toList (1 .. #expandedIdentity) + trimmedIdentity = permutation {1} + extendedIdentity = permutation toList (1..8) + extendedList = toList (1 .. #extendedIdentity) -- miscellaneous - assert(inverse reducedIdentity == reducedIdentity) - assert(inverse expandedIdentity == expandedIdentity) - assert(ord reducedIdentity == 1) - assert(ord expandedIdentity == 1) - assert(sign reducedIdentity == 1) - assert(sign expandedIdentity == 1) - assert(isEven reducedIdentity) - assert(isEven expandedIdentity) - assert(not isOdd reducedIdentity) - assert(not isOdd expandedIdentity) - assert(not isDerangement reducedIdentity) - assert(not isDerangement expandedIdentity) - assert(fixedPoints reducedIdentity == {1}) - assert(fixedPoints expandedIdentity == expandedList) - assert(inversions reducedIdentity == {}) - assert(inversions expandedIdentity == {}) + assert(inverse trimmedIdentity == trimmedIdentity) + assert(inverse extendedIdentity == extendedIdentity) + assert(ord trimmedIdentity == 1) + assert(ord extendedIdentity == 1) + assert(sign trimmedIdentity == 1) + assert(sign extendedIdentity == 1) + assert(isEven trimmedIdentity) + assert(isEven extendedIdentity) + assert(not isOdd trimmedIdentity) + assert(not isOdd extendedIdentity) + assert(not isDerangement trimmedIdentity) + assert(not isDerangement extendedIdentity) + assert(fixedPoints trimmedIdentity == {1}) + assert(fixedPoints extendedIdentity == extendedList) + assert(inversions trimmedIdentity == {}) + assert(inversions extendedIdentity == {}) + assert(length trimmedIdentity == 0) + assert(length extendedIdentity == 0) /// TEST /// @@ -222,7 +224,7 @@ TEST /// ----------------------- p = permutation reverse toList (1..10) pList = toList p - expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + extendedP = permutation(pList | {max(pList)+1, max(pList)+2}) -- indexing into a permutation assert(p_1 == 10) @@ -238,40 +240,40 @@ TEST /// ----------------------- p = permutation reverse toList (1..10) pList = toList p - expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + extendedP = permutation(pList | {max(pList)+1, max(pList)+2}) - -- expand and reduce are inverse processes - assert(reduce p == p) - assert(expand(p, #p+2) == expandedP) - assert(reduce expand(p, #p+2) == p) + -- extend and trim are inverse processes + assert(trim p == p) + assert(extend(p, #p+2) == extendedP) + assert(trim extend(p, #p+2) == p) /// TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} + trimmedIdentity = permutation {1} ----------------------- -- longest permutation ----------------------- p = permutation reverse toList (1..10) pList = toList p - expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + extendedP = permutation(pList | {max(pList)+1, max(pList)+2}) -- basic operations -- equality - assert(p == expandedP) - -- assert(reducedIdentity != permutation reverse expandedList) - assert(reducedIdentity != reverse expandedP) + assert(p == extendedP) + -- assert(trimmedIdentity != permutation reverse extendedList) + assert(trimmedIdentity != reverse extendedP) -- multiplication - assert(reducedIdentity*reducedIdentity == reducedIdentity) + assert(trimmedIdentity*trimmedIdentity == trimmedIdentity) -- powers - assert(p^2 == reducedIdentity) + assert(p^2 == trimmedIdentity) assert(p^5 == p) assert(p^(-1) == p) assert(p^(-5) == p) - assert(p^0 == reducedIdentity) + assert(p^0 == trimmedIdentity) /// TEST /// @@ -280,7 +282,7 @@ TEST /// ----------------------- p = permutation reverse toList (1..10) pList = toList p - expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + extendedP = permutation(pList | {max(pList)+1, max(pList)+2}) -- matrix representation antiDiagIdentity = matrix for i in (0 ..< #p) list for j in (0 ..< #p) list if i+j == #p-1 then 1 else 0 @@ -293,11 +295,11 @@ TEST /// ----------------------- p = permutation reverse toList (1..10) pList = toList p - expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + extendedP = permutation(pList | {max(pList)+1, max(pList)+2}) -- Group actions assert(p * toList(1 .. #p) == pList) - assert(p * toList(1 .. #p+2) == toList expandedP) + assert(p * toList(1 .. #p+2) == toList extendedP) assert(p * {5,4,3,2,1,10,9,8,7,6} == {6,7,8,9,10,1,2,3,4,5}) assert(p * (toMatrix p) == id_(ZZ^#p)) @@ -319,7 +321,7 @@ TEST /// ----------------------- p = permutation reverse toList (1..10) pList = toList p - expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + extendedP = permutation(pList | {max(pList)+1, max(pList)+2}) -- cycle decomposition assert(cycleDecomposition p == {(6,5), (7,4), (8,3), (9,2), (10,1)}) @@ -332,7 +334,7 @@ TEST /// ----------------------- p = permutation reverse toList (1..10) pList = toList p - expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + extendedP = permutation(pList | {max(pList)+1, max(pList)+2}) -- Ascents, descents, runs, exceedances, and records assert(ascents p == {}) @@ -351,7 +353,7 @@ TEST /// ----------------------- p = permutation reverse toList (1..10) pList = toList p - expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + extendedP = permutation(pList | {max(pList)+1, max(pList)+2}) -- pattern avoidance assert(isVexillary p) @@ -365,7 +367,7 @@ TEST /// ----------------------- p = permutation reverse toList (1..10) pList = toList p - expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + extendedP = permutation(pList | {max(pList)+1, max(pList)+2}) -- Foata's fundamental bijection assert(foataBijection p == permutation {6,5,7,4,8,3,9,2,10,1}) @@ -377,7 +379,7 @@ TEST /// ----------------------- p = permutation reverse toList (1..10) pList = toList p - expandedP = permutation(pList | {max(pList)+1, max(pList)+2}) + extendedP = permutation(pList | {max(pList)+1, max(pList)+2}) -- miscellaneous assert(inverse p == p) @@ -388,27 +390,37 @@ TEST /// assert(isDerangement p) assert(fixedPoints p == {}) assert(sort inversions p == sort subsets(1 .. #p, 2)) + assert(length p == binomial(#(toList p), 2)) /// TEST /// ----------------------- -- identity permutation ----------------------- - reducedIdentity = permutation {1} + trimmedIdentity = permutation {1} ------- -- Misc ------- p = permutation random toList (1..10) - assert((inverse p)*p == reducedIdentity) - assert(p*(inverse p) == reducedIdentity) + assert((inverse p)*p == trimmedIdentity) + assert(p*(inverse p) == trimmedIdentity) assert(ord p == ord inverse p) assert(cycleType p == cycleType inverse p) assert(sign p == sign inverse p) +/// - -- some more pattern avoidance +TEST /// + -------------------- + -- Pattern avoidance + -------------------- assert(not avoidsPattern(permutation {2,3,7,1,5,8,4,6}, {1,4,3,2})) assert(avoidsPattern(permutation {1,4,6,2,3,7,5}, {1,4,3,2})) + + -- assert(not isPatternAvoiding(permutation {3,1,2},{3,1,2})); + -- assert(not isPatternAvoiding(permutation {1,2,3,6,4,5}, {3,1,2})); + -- assert(isPatternAvoiding(permutation {3,1,2},{2,3,1})); + assert(not isVexillary(permutation {7,2,5,8,1,3,6,4})) assert(isVexillary(permutation {1,6,9,2,4,7,3,5,8})) /// \ No newline at end of file From 208a050f70af0772f7667480b1ccc77f17b37e25 Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Wed, 7 Aug 2024 20:45:52 -0500 Subject: [PATCH 004/226] Fixed newPackage header --- M2/Macaulay2/packages/Permutations.m2 | 48 +++++++++------------------ 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/M2/Macaulay2/packages/Permutations.m2 b/M2/Macaulay2/packages/Permutations.m2 index 87d49d06450..dbb6e11228c 100644 --- a/M2/Macaulay2/packages/Permutations.m2 +++ b/M2/Macaulay2/packages/Permutations.m2 @@ -2,31 +2,22 @@ newPackage( "Permutations", AuxiliaryFiles => true, Version => "1.0", - Date => "June 4, 2024", + Date => "August 7, 2024", Keywords => {"Combinatorics"}, Authors => { {Name => "Sean Grate", Email => "sean.grate@auburn.edu", HomePage => "https://seangrate.com/"} - }, - Headline => "functions for working with permutations", - PackageExports => { - -- "SimplicialComplexes", - -- "SimplicialDecomposability", - -- "Posets", - -- "MinimalPrimes" }, - DebuggingMode => true + Headline => "functions for working with permutations" ) -export{ +export { -- types "Permutation", -- methods "permutation", "isValidPermutation", - "reduce", - "expand", "toMatrix", "cycleDecomposition", "cycleType", @@ -43,7 +34,6 @@ export{ "isCartwrightSturmfels", "isCDG", "foataBijection", - -- "inverse", "ord", "sign", "isEven", @@ -55,33 +45,27 @@ export{ "Weak" } ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- +------------------------------------ -- **CODE** -- ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- +------------------------------------ load "./Permutations/Permutations.m2" ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- + + +------------------------------------ -- **DOCUMENTATION** -- ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -beginDocumentation () +------------------------------------ +beginDocumentation() load "./Permutations/PermutationsDOC.m2" ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- + +------------------------------------ -- **TESTS** -- ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- +------------------------------------ load "./Permutations/PermutationsTests.m2" +end -end--------------------------------------------------------------------------- - ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- +------------------------------------ -- **SCRATCH SPACE** -- ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- +------------------------------------ ------------------------------------ From 2534b4551acaaacda568458aa7481ca86ebde3c6 Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Wed, 7 Aug 2024 20:54:59 -0500 Subject: [PATCH 005/226] Moved methods into main Permutations package file --- M2/Macaulay2/packages/Permutations.m2 | 324 +++++++++++++++++- .../packages/Permutations/Permutations.m2 | 311 ----------------- 2 files changed, 314 insertions(+), 321 deletions(-) delete mode 100644 M2/Macaulay2/packages/Permutations/Permutations.m2 diff --git a/M2/Macaulay2/packages/Permutations.m2 b/M2/Macaulay2/packages/Permutations.m2 index dbb6e11228c..6ef10ee4671 100644 --- a/M2/Macaulay2/packages/Permutations.m2 +++ b/M2/Macaulay2/packages/Permutations.m2 @@ -45,33 +45,337 @@ export { "Weak" } ------------------------------------- +----------------------------------------------------------------------------- -- **CODE** -- +----------------------------------------------------------------------------- +------------------------------------ +-- Local utilities +------------------------------------ +to1Index := w -> (w / (i -> i+1)) +to0Index := w -> (w / (i -> i-1)) + +------------------------------------ +-- Permutation type declarations and basic constructors ------------------------------------ -load "./Permutations/Permutations.m2" +Permutation = new Type of BasicList +Permutation.synonym = "permutation" + +isValidPermutation = method(TypicalValue => Boolean) +isValidPermutation List := Boolean => w -> (((sort w) == toList(1..#w)) and not (#w == 0)) +new Permutation from BasicList := (typeofPermutation,w) -> ( + if not isValidPermutation(w) then error(toString w | " is not a valid permutation in one-line notation."); + w +) + +permutation = method(TypicalValue => Permutation) +permutation List := Permutation => w -> new Permutation from w ------------------------------------ --- **DOCUMENTATION** -- +-- Permutation string representations ------------------------------------ -beginDocumentation() -load "./Permutations/PermutationsDOC.m2" +expression Permutation := w -> expression toList w +toString Permutation := w -> toString expression toList w +tex Permutation := w -> tex expression toSequence w +html Permutation := w -> html expression toList w ------------------------------------ --- **TESTS** -- +-- Indexing permutations as lists ------------------------------------ -load "./Permutations/PermutationsTests.m2" -end +Permutation _ ZZ := ZZ => (w,n) -> ((toList w)_(n-1)) +Permutation _ List := List => (w,l) -> ((toList w)_l) +Permutation _ Sequence := List => (w,s) -> ((toList w)_(toList s)) ------------------------------------ --- **SCRATCH SPACE** -- +-- Change which symmetric group S_n to view a permutation as an element of ------------------------------------ +trim Permutation := Permutation => o -> w -> ( + w = w_(select(#w, i -> w_{i ..< #w} != toList(i+1 .. #w))); + if #w == 0 then permutation {1} else permutation w +) + +extend (Permutation, ZZ) := Permutation => o -> (w,n) -> ( + if n < #w then error(toString w | " is a permutation on more than " | toString n | " letters."); + permutation(toList(w) | toList(#w+1..n)) +) +extend (Permutation, Permutation) := Sequence => o -> (w,v) -> ( + n := max(#w, #v); + (extend(w,n), extend(v,n)) +) +------------------------------------ +-- Basic permutation operations +------------------------------------ +Permutation == Permutation := Boolean => (w, v) -> ( + (w, v) = extend(w,v); + toList(w) == toList(v) +) +Permutation * Permutation := Permutation => (w, v) -> ( + (w,v) = extend(w,v); + trim permutation w_(to0Index toList v) +) +-- power implementation modified from Mahrud's in https://github.com/Macaulay2/M2/issues/2581 +Permutation ^ ZZ := Permutation => (w, n) -> fold(if n < 0 then (-n):(permutation to1Index inversePermutation to0Index toList w) else n:w, + permutation toList (1 .. #w), + (w, v) -> w*v) ------------------------------------ ---Development Section +-- Matrix representation of a permutation +------------------------------------ +-- some people prefer the transpose of this +toMatrix = method(TypicalValue => Matrix) +toMatrix Permutation := Matrix => w -> ( + id_(ZZ^(#w))_(to0Index toList w) +) + +------------------------------------ +-- Group actions +------------------------------------ +Permutation * List := List => (w, l) -> ( + if #(trim w) > #l then error(toString w | " permutes more than " | toString #l | " elements.") + else l_(to0Index toList extend(w, #l)) +) +-- group action on a matrix permutes the ROWS of the matrix +-- maybe would prefer to permute the columns? Seems more natural +Permutation * Matrix := Matrix => (w, M) -> ( + m := numRows M; + if #(trim w) > m then error(toString w | " permutes more than " | toString m | " elements.") + else (toMatrix extend(w, m)) * M +) + +------------------------------------ +-- Cycle decomposition of a permutation +------------------------------------ +-- every permutation can be written as a product of disjoint cycles (in cycle notation) +cycleDecomposition = method(TypicalValue => List) +cycleDecomposition Permutation := List => w -> ( + w = to0Index toList w; + cycles := {}; + unvisited := toList(0 ..< #w); + while #unvisited != 0 do ( + startIdx := unvisited#0; + visited := {startIdx}; + nextIdx := w#startIdx; + while nextIdx != startIdx do ( + visited = append(visited, nextIdx); + nextIdx = w#nextIdx; + ); + cycles = append(cycles, visited); + for idx in visited do unvisited = delete(idx, unvisited); + ); + cycles = cycles / to1Index / toSequence; + -- put decomposition into its standard or canonical representation (see https://en.wikipedia.org/wiki/Permutation#canonical_cycle_notation) + -- a permutation's cycle decomposition is "canonical" or "standard" if + -- 1. each cycle lists the largest element first and + -- 2. the cycles are sorted by their first element in increasing order + sortedCycles := for cycle in cycles list toSequence rotate(maxPosition cycle, toList cycle); + sort sortedCycles +) + +cycleType = method(TypicalValue => Sequence) +cycleType Permutation := Sequence => w -> ( + toSequence rsort for cycle in cycleDecomposition w list #cycle +) + +------------------------------------ +-- Ascents, descents, runs, exceedances, and records +-- NOTE: All return the 1-indexed results for consistency with the permutation notation +------------------------------------ +ascents = method(TypicalValue => List) +ascents Permutation := List => w -> ( + for i in 1 ..< #w list if w_i < w_(i+1) then i else continue +) + +descents = method(TypicalValue => List) +descents Permutation := List => w -> ( + for i in 1 ..< #w list if w_i > w_(i+1) then i else continue +) + +ascendingRuns = method(TypicalValue => List) +ascendingRuns Permutation := List => w -> ( + -- inspired from the SageMath implementation + -- https://github.com/sagemath/sage/blob/develop/src/sage/combinat/permutation.py + if #w == 1 then allRuns := {toSequence w} + else ( + allRuns = {}; + currentRun := {w#0}; + for wi in w_(toList(1 ..< #w)) do ( + if wi > last currentRun then currentRun = append(currentRun, wi) + else ( + allRuns = append(allRuns, toSequence currentRun); + currentRun = {wi}; + ); + ); + allRuns = append(allRuns, toSequence currentRun); + ); + allRuns +) + +descendingRuns = method(TypicalValue => List) +descendingRuns Permutation := List => w -> ( + -- inspired from the SageMath implementation + -- https://github.com/sagemath/sage/blob/develop/src/sage/combinat/permutation.py + if #w == 1 then allRuns := {toSequence w} + else ( + allRuns = {}; + currentRun := {w#0}; + for wi in w_(toList(1 ..< #w)) do ( + if wi < last currentRun then currentRun = append(currentRun, wi) + else ( + allRuns = append(allRuns, toSequence currentRun); + currentRun = {wi}; + ); + ); + allRuns = append(allRuns, toSequence currentRun); + ); + allRuns +) + +exceedances = method(TypicalValue => List, + Options => {Weak => false}) +exceedances Permutation := List => opts -> w -> ( + compare := if opts.Weak then ((i,j) -> i <= j) else ((i,j) -> i < j); + for i in 1 .. #w list if compare(i,w_i) then i else continue +) + +saliances = method(TypicalValue => List) +saliances Permutation := List => w -> ( + to1Index positions(1 .. #w, i -> all(i+1 .. #w, j -> w_i > w_j)) +) + +records = method(TypicalValue => List) +records Permutation := List => w -> ( + to1Index positions(1 .. #w, i -> all(1 ..< i, j -> w_j < w_i)) +) + +------------------------------------ +-- Pattern avoidance +------------------------------------ +avoidsPattern = method(TypicalValue => Boolean) +avoidsPattern (Permutation,List) := Boolean => (w, pattern) -> ( + --assume permutation is pattern-avoiding, break if not true + for idx in subsets(0 .. #w-1, #pattern) do { + vals := w_(idx); + sortedVals := sort(vals); + relPositions := hashTable toList apply(0..#vals-1, i -> {sortedVals#i, i}); + p := toList apply(vals, i -> (relPositions#i) + 1); + if p == pattern then return false; + }; + true +) + +avoidsPatterns = method(TypicalValue => Boolean) +avoidsPatterns (Permutation, List) := Boolean => (w, patterns) -> ( + all(patterns, pattern -> avoidsPattern(w, pattern)) +) + +isVexillary = method(TypicalValue => Boolean) +isVexillary Permutation := Boolean => (w) -> ( + avoidsPattern(w, {2,1,4,3}) +) + +isCartwrightSturmfels = method(TypicalValue => Boolean) +isCartwrightSturmfels Permutation := Boolean => w -> ( + patterns := {{1,2,5,4,3}, + {1,3,2,5,4}, + {1,3,5,2,4}, + {1,3,5,4,2}, + {2,1,5,4,3}, + {1,2,5,3,6,4}, + {1,2,5,6,3,4}, + {2,1,5,3,6,4}, + {2,1,5,6,3,4}, + {3,1,5,2,6,4}, + {3,1,5,6,2,4}, + {3,1,5,6,4,2}}; + avoidsPatterns(w, patterns) +) + +isCDG = method(TypicalValue => Boolean) +isCDG Permutation := Boolean => w -> ( + patterns := {{1,3,2,5,4}, + {2,1,5,4,3}, + {2,1,4,6,3,5}, + {2,1,5,3,6,4}, + {2,1,5,6,3,4}, + {2,4,1,6,3,5}, + {3,1,5,2,6,4}, + {4,2,6,1,7,3,5}}; + avoidsPatterns(w, patterns) +) + ------------------------------------ +-- Foata's fundamental bijection +------------------------------------ +-- see https://en.wikipedia.org/wiki/Permutation#Foata's_transition_lemma +foataBijection = method(TypicalValue => Permutation) +foataBijection Permutation := Permutation => w -> ( + permutation splice cycleDecomposition w +) + +------------------------------------ +-- Miscellaneous +------------------------------------ +-- inverse = method() +inverse Permutation := Permutation => w -> (permutation to1Index inversePermutation to0Index toList w) + +-- order of a permutation, i.e. smallest integer n such that w^n = identity +-- the order of a permutation can be expressed as the lcm of its cycle lengths +ord = method(TypicalValue => ZZ) +ord Permutation := ZZ => w -> ( + lcm((cycleDecomposition w) / length) +) + +-- see https://en.wikipedia.org/wiki/Parity_of_a_permutation for different ways +-- to compute the sign or parity of a permutation +sign = method(TypicalValue => ZZ) +sign Permutation := ZZ => w -> ( + if even(#w - #(cycleDecomposition w)) then 1 else -1 +) + +isEven = method(TypicalValue => Boolean) +isEven Permutation := Boolean => w -> ( + sign w == 1 +) + +isOdd = method(TypicalValue => Boolean) +isOdd Permutation := Boolean => w -> ( + sign w == -1 +) + +isDerangement = method(TypicalValue => Boolean) +isDerangement Permutation := Boolean => w -> (not any(cycleDecomposition w, cycle -> #cycle == 1)) + +fixedPoints = method(TypicalValue => List) +fixedPoints Permutation := Boolean => w -> (for cycle in cycleDecomposition w list if #cycle == 1 then unsequence cycle else continue) + +inversions = method(TypicalValue => List) +inversions Permutation := List => w -> ( + for idxPair in sort(subsets(toList w, 2) / sort) list if w_(idxPair#0) > w_(idxPair#1) then idxPair else continue +) + +length Permutation := ZZ => w -> (#(inversions w)) +----------------------------------------------------------------------------- +-- **DOCUMENTATION** -- +----------------------------------------------------------------------------- +beginDocumentation() +load "./Permutations/PermutationsDOC.m2" + +----------------------------------------------------------------------------- +-- **TESTS** -- +----------------------------------------------------------------------------- +load "./Permutations/PermutationsTests.m2" +end + +----------------------------------------------------------------------------- +-- **SCRATCH SPACE** -- +----------------------------------------------------------------------------- + + +----------------------------------------------------------------------------- +--Development Section +----------------------------------------------------------------------------- restart uninstallPackage "Permutations" restart diff --git a/M2/Macaulay2/packages/Permutations/Permutations.m2 b/M2/Macaulay2/packages/Permutations/Permutations.m2 deleted file mode 100644 index 571257215bd..00000000000 --- a/M2/Macaulay2/packages/Permutations/Permutations.m2 +++ /dev/null @@ -1,311 +0,0 @@ --- Sean Grate - ------------------------------------------------------------------------------ --- Local utilities ------------------------------------------------------------------------------ - -to1Index = w -> (w / (i -> i+1)) -to0Index = w -> (w / (i -> i-1)) - ------------------------------------------------------------------------------ --- Permutation type declarations and basic constructors ------------------------------------------------------------------------------ - -Permutation = new Type of BasicList -Permutation.synonym = "permutation" - -isValidPermutation = method(TypicalValue => Boolean) -isValidPermutation List := Boolean => w -> (((sort w) == toList(1..#w)) and not (#w == 0)) - -new Permutation from BasicList := (typeofPermutation,w) -> ( - if not isValidPermutation(w) then error(toString w | " is not a valid permutation in one-line notation."); - w -) - -permutation = method(TypicalValue => Permutation) -permutation List := Permutation => w -> new Permutation from w - ------------------------------------------------------------------------------ --- Permutation string representations ------------------------------------------------------------------------------ -expression Permutation := w -> expression toList w -toString Permutation := w -> toString expression toList w -tex Permutation := w -> tex expression toSequence w -html Permutation := w -> html expression toList w - ------------------------------------------------------------------------------ --- Indexing permutations as lists ------------------------------------------------------------------------------ -Permutation _ ZZ := ZZ => (w,n) -> ((toList w)_(n-1)) -Permutation _ List := List => (w,l) -> ((toList w)_l) -Permutation _ Sequence := List => (w,s) -> ((toList w)_(toList s)) - ------------------------------------------------------------------------------ --- Change which symmetric group S_n to view a permutation as an element of ------------------------------------------------------------------------------ -trim Permutation := Permutation => o -> w -> ( - w = w_(select(#w, i -> w_{i ..< #w} != toList(i+1 .. #w))); - if #w == 0 then permutation {1} else permutation w -) - -extend (Permutation, ZZ) := Permutation => o -> (w,n) -> ( - if n < #w then error(toString w | " is a permutation on more than " | toString n | " letters."); - permutation(toList(w) | toList(#w+1..n)) -) -extend (Permutation, Permutation) := Sequence => o -> (w,v) -> ( - n := max(#w, #v); - (extend(w,n), extend(v,n)) -) - ------------------------------------------------------------------------------ --- Basic permutation operations ------------------------------------------------------------------------------ -Permutation == Permutation := Boolean => (w, v) -> ( - (w, v) = extend(w,v); - toList(w) == toList(v) -) -Permutation * Permutation := Permutation => (w, v) -> ( - (w,v) = extend(w,v); - trim permutation w_(to0Index toList v) -) --- power implementation modified from Mahrud's in https://github.com/Macaulay2/M2/issues/2581 -Permutation ^ ZZ := Permutation => (w, n) -> fold(if n < 0 then (-n):(permutation to1Index inversePermutation to0Index toList w) else n:w, - permutation toList (1 .. #w), - (w, v) -> w*v) - ------------------------------------------------------------------------------ --- Matrix representation of a permutation ------------------------------------------------------------------------------ --- some people prefer the transpose of this -toMatrix = method(TypicalValue => Matrix) -toMatrix Permutation := Matrix => w -> ( - id_(ZZ^(#w))_(to0Index toList w) -) - ------------------------------------------------------------------------------ --- Group actions ------------------------------------------------------------------------------ -Permutation * List := List => (w, l) -> ( - if #(trim w) > #l then error(toString w | " permutes more than " | toString #l | " elements.") - else l_(to0Index toList extend(w, #l)) -) --- group action on a matrix permutes the ROWS of the matrix --- maybe would prefer to permute the columns? Seems more natural -Permutation * Matrix := Matrix => (w, M) -> ( - m := numRows M; - if #(trim w) > m then error(toString w | " permutes more than " | toString m | " elements.") - else (toMatrix extend(w, m)) * M -) - ------------------------------------------------------------------------------ --- Cycle decomposition of a permutation ------------------------------------------------------------------------------ --- every permutation can be written as a product of disjoint cycles (in cycle notation) -cycleDecomposition = method(TypicalValue => List) -cycleDecomposition Permutation := List => w -> ( - w = to0Index toList w; - cycles := {}; - unvisited := toList(0 ..< #w); - while #unvisited != 0 do ( - startIdx := unvisited#0; - visited := {startIdx}; - nextIdx := w#startIdx; - while nextIdx != startIdx do ( - visited = append(visited, nextIdx); - nextIdx = w#nextIdx; - ); - cycles = append(cycles, visited); - for idx in visited do unvisited = delete(idx, unvisited); - ); - cycles = cycles / to1Index / toSequence; - -- put decomposition into its standard or canonical representation (see https://en.wikipedia.org/wiki/Permutation#canonical_cycle_notation) - -- a permutation's cycle decomposition is "canonical" or "standard" if - -- 1. each cycle lists the largest element first and - -- 2. the cycles are sorted by their first element in increasing order - sortedCycles := for cycle in cycles list toSequence rotate(maxPosition cycle, toList cycle); - sort sortedCycles -) - -cycleType = method(TypicalValue => Sequence) -cycleType Permutation := Sequence => w -> ( - toSequence rsort for cycle in cycleDecomposition w list #cycle -) - ------------------------------------------------------------------------------ --- Ascents, descents, runs, exceedances, and records --- NOTE: All return the 1-indexed results for consistency with the permutation notation ------------------------------------------------------------------------------ -ascents = method(TypicalValue => List) -ascents Permutation := List => w -> ( - for i in 1 ..< #w list if w_i < w_(i+1) then i else continue -) - -descents = method(TypicalValue => List) -descents Permutation := List => w -> ( - for i in 1 ..< #w list if w_i > w_(i+1) then i else continue -) - -ascendingRuns = method(TypicalValue => List) -ascendingRuns Permutation := List => w -> ( - -- inspired from the SageMath implementation - -- https://github.com/sagemath/sage/blob/develop/src/sage/combinat/permutation.py - if #w == 1 then allRuns := {toSequence w} - else ( - allRuns = {}; - currentRun := {w#0}; - for wi in w_(toList(1 ..< #w)) do ( - if wi > last currentRun then currentRun = append(currentRun, wi) - else ( - allRuns = append(allRuns, toSequence currentRun); - currentRun = {wi}; - ); - ); - allRuns = append(allRuns, toSequence currentRun); - ); - allRuns -) - -descendingRuns = method(TypicalValue => List) -descendingRuns Permutation := List => w -> ( - -- inspired from the SageMath implementation - -- https://github.com/sagemath/sage/blob/develop/src/sage/combinat/permutation.py - if #w == 1 then allRuns := {toSequence w} - else ( - allRuns = {}; - currentRun := {w#0}; - for wi in w_(toList(1 ..< #w)) do ( - if wi < last currentRun then currentRun = append(currentRun, wi) - else ( - allRuns = append(allRuns, toSequence currentRun); - currentRun = {wi}; - ); - ); - allRuns = append(allRuns, toSequence currentRun); - ); - allRuns -) - -exceedances = method(TypicalValue => List, - Options => {Weak => false}) -exceedances Permutation := List => opts -> w -> ( - compare := if opts.Weak then ((i,j) -> i <= j) else ((i,j) -> i < j); - for i in 1 .. #w list if compare(i,w_i) then i else continue -) - -saliances = method(TypicalValue => List) -saliances Permutation := List => w -> ( - to1Index positions(1 .. #w, i -> all(i+1 .. #w, j -> w_i > w_j)) -) - -records = method(TypicalValue => List) -records Permutation := List => w -> ( - to1Index positions(1 .. #w, i -> all(1 ..< i, j -> w_j < w_i)) -) - ------------------------------------------------------------------------------ --- Pattern avoidance ------------------------------------------------------------------------------ -avoidsPattern = method(TypicalValue => Boolean) -avoidsPattern (Permutation,List) := Boolean => (w, pattern) -> ( - --assume permutation is pattern-avoiding, break if not true - for idx in subsets(0 .. #w-1, #pattern) do { - vals := w_(idx); - sortedVals := sort(vals); - relPositions := hashTable toList apply(0..#vals-1, i -> {sortedVals#i, i}); - p := toList apply(vals, i -> (relPositions#i) + 1); - if p == pattern then return false; - }; - true -) - -avoidsPatterns = method(TypicalValue => Boolean) -avoidsPatterns (Permutation, List) := Boolean => (w, patterns) -> ( - all(patterns, pattern -> avoidsPattern(w, pattern)) -) - -isVexillary = method(TypicalValue => Boolean) -isVexillary Permutation := Boolean => (w) -> ( - avoidsPattern(w, {2,1,4,3}) -) - -isCartwrightSturmfels = method(TypicalValue => Boolean) -isCartwrightSturmfels Permutation := Boolean => w -> ( - patterns := {{1,2,5,4,3}, - {1,3,2,5,4}, - {1,3,5,2,4}, - {1,3,5,4,2}, - {2,1,5,4,3}, - {1,2,5,3,6,4}, - {1,2,5,6,3,4}, - {2,1,5,3,6,4}, - {2,1,5,6,3,4}, - {3,1,5,2,6,4}, - {3,1,5,6,2,4}, - {3,1,5,6,4,2}}; - avoidsPatterns(w, patterns) -) - -isCDG = method(TypicalValue => Boolean) -isCDG Permutation := Boolean => w -> ( - patterns := {{1,3,2,5,4}, - {2,1,5,4,3}, - {2,1,4,6,3,5}, - {2,1,5,3,6,4}, - {2,1,5,6,3,4}, - {2,4,1,6,3,5}, - {3,1,5,2,6,4}, - {4,2,6,1,7,3,5}}; - avoidsPatterns(w, patterns) -) - ------------------------------------------------------------------------------ --- Foata's fundamental bijection ------------------------------------------------------------------------------ --- see https://en.wikipedia.org/wiki/Permutation#Foata's_transition_lemma -foataBijection = method(TypicalValue => Permutation) -foataBijection Permutation := Permutation => w -> ( - permutation splice cycleDecomposition w -) - ------------------------------------------------------------------------------ --- Miscellaneous ------------------------------------------------------------------------------ --- inverse = method() -inverse Permutation := Permutation => w -> (permutation to1Index inversePermutation to0Index toList w) - --- order of a permutation, i.e. smallest integer n such that w^n = identity --- the order of a permutation can be expressed as the lcm of its cycle lengths -ord = method(TypicalValue => ZZ) -ord Permutation := ZZ => w -> ( - lcm((cycleDecomposition w) / length) -) - --- see https://en.wikipedia.org/wiki/Parity_of_a_permutation for different ways --- to compute the sign or parity of a permutation -sign = method(TypicalValue => ZZ) -sign Permutation := ZZ => w -> ( - if even(#w - #(cycleDecomposition w)) then 1 else -1 -) - -isEven = method(TypicalValue => Boolean) -isEven Permutation := Boolean => w -> ( - sign w == 1 -) - -isOdd = method(TypicalValue => Boolean) -isOdd Permutation := Boolean => w -> ( - sign w == -1 -) - -isDerangement = method(TypicalValue => Boolean) -isDerangement Permutation := Boolean => w -> (not any(cycleDecomposition w, cycle -> #cycle == 1)) - -fixedPoints = method(TypicalValue => List) -fixedPoints Permutation := Boolean => w -> (for cycle in cycleDecomposition w list if #cycle == 1 then unsequence cycle else continue) - -inversions = method(TypicalValue => List) -inversions Permutation := List => w -> ( - for idxPair in sort(subsets(toList w, 2) / sort) list if w_(idxPair#0) > w_(idxPair#1) then idxPair else continue -) - -length Permutation := ZZ => w -> (#(inversions w)) From ada85ab082c873f8c92fdffde5779957d7a259a5 Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Wed, 7 Aug 2024 20:57:16 -0500 Subject: [PATCH 006/226] Renamed auxiliary files --- M2/Macaulay2/packages/Permutations.m2 | 4 ++-- .../packages/Permutations/{PermutationsDOC.m2 => docs.m2} | 0 .../packages/Permutations/{PermutationsTests.m2 => tests.m2} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename M2/Macaulay2/packages/Permutations/{PermutationsDOC.m2 => docs.m2} (100%) rename M2/Macaulay2/packages/Permutations/{PermutationsTests.m2 => tests.m2} (100%) diff --git a/M2/Macaulay2/packages/Permutations.m2 b/M2/Macaulay2/packages/Permutations.m2 index 6ef10ee4671..d907ed18639 100644 --- a/M2/Macaulay2/packages/Permutations.m2 +++ b/M2/Macaulay2/packages/Permutations.m2 @@ -360,12 +360,12 @@ length Permutation := ZZ => w -> (#(inversions w)) -- **DOCUMENTATION** -- ----------------------------------------------------------------------------- beginDocumentation() -load "./Permutations/PermutationsDOC.m2" +load "./Permutations/docs.m2" ----------------------------------------------------------------------------- -- **TESTS** -- ----------------------------------------------------------------------------- -load "./Permutations/PermutationsTests.m2" +load "./Permutations/tests.m2" end ----------------------------------------------------------------------------- diff --git a/M2/Macaulay2/packages/Permutations/PermutationsDOC.m2 b/M2/Macaulay2/packages/Permutations/docs.m2 similarity index 100% rename from M2/Macaulay2/packages/Permutations/PermutationsDOC.m2 rename to M2/Macaulay2/packages/Permutations/docs.m2 diff --git a/M2/Macaulay2/packages/Permutations/PermutationsTests.m2 b/M2/Macaulay2/packages/Permutations/tests.m2 similarity index 100% rename from M2/Macaulay2/packages/Permutations/PermutationsTests.m2 rename to M2/Macaulay2/packages/Permutations/tests.m2 From 1680d6b103436d183033d5bb5e6014d37172f2e5 Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Wed, 7 Aug 2024 20:58:58 -0500 Subject: [PATCH 007/226] Fixed typos --- M2/Macaulay2/packages/Permutations/docs.m2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/Permutations/docs.m2 b/M2/Macaulay2/packages/Permutations/docs.m2 index 576b3b4bbf8..00e7dd4d3ab 100644 --- a/M2/Macaulay2/packages/Permutations/docs.m2 +++ b/M2/Macaulay2/packages/Permutations/docs.m2 @@ -238,7 +238,7 @@ doc /// inverse p Text The \emph{order} of a permutation $p$ is its order in the symmetric group $\mathfrak{S}_n$, i.e., - the smallest postive integer $k$ such that $p^k$ is the identity permutation. + the smallest positive integer $k$ such that $p^k$ is the identity permutation. Example p = permutation {3,1,2,5,4}; ord p @@ -619,7 +619,7 @@ doc /// avoidsPatterns (avoidsPatterns, Permutation, List) Headline - whether a permutation simulataneously avoids a list of patterns + whether a permutation simultaneously avoids a list of patterns Usage avoidsPatterns(w, patterns) Inputs From 05c3b3202647fc5adc5761d3b87d407012a26e76 Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Wed, 7 Aug 2024 21:02:09 -0500 Subject: [PATCH 008/226] Updated with Permutations package --- M2/Macaulay2/packages/=distributed-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/M2/Macaulay2/packages/=distributed-packages b/M2/Macaulay2/packages/=distributed-packages index 9e40f2b997f..eebe03d1fad 100644 --- a/M2/Macaulay2/packages/=distributed-packages +++ b/M2/Macaulay2/packages/=distributed-packages @@ -271,3 +271,4 @@ SchurVeronese VNumber TropicalToric MultigradedBGG +Permutations From 844cb2ac537819f1d7f68a81d0595dbc203c40e0 Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Wed, 7 Aug 2024 21:04:27 -0500 Subject: [PATCH 009/226] Readded from original --- M2/Macaulay2/tests/normal/permutations.m2 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 M2/Macaulay2/tests/normal/permutations.m2 diff --git a/M2/Macaulay2/tests/normal/permutations.m2 b/M2/Macaulay2/tests/normal/permutations.m2 new file mode 100644 index 00000000000..1d4bb99be0b --- /dev/null +++ b/M2/Macaulay2/tests/normal/permutations.m2 @@ -0,0 +1,5 @@ +f = id_(ZZ^5) +v = {1,2,4,3,0} +w = {3,1,2,4,0} +assert(f_(v_w)==(f_v)_w) +assert(f_(v_w)==(f_v)*(f_w)) \ No newline at end of file From 4d919b758a85de04f99061c5ea461c8fad03d961 Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Wed, 7 Aug 2024 21:23:51 -0500 Subject: [PATCH 010/226] isValidPermutation -> isWellDefined --- M2/Macaulay2/packages/Permutations.m2 | 14 ++++++-------- M2/Macaulay2/packages/Permutations/docs.m2 | 21 ++++++++++----------- M2/Macaulay2/packages/Permutations/tests.m2 | 16 ++++++++-------- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/M2/Macaulay2/packages/Permutations.m2 b/M2/Macaulay2/packages/Permutations.m2 index d907ed18639..6a23d4c8fd5 100644 --- a/M2/Macaulay2/packages/Permutations.m2 +++ b/M2/Macaulay2/packages/Permutations.m2 @@ -17,7 +17,6 @@ export { "Permutation", -- methods "permutation", - "isValidPermutation", "toMatrix", "cycleDecomposition", "cycleType", @@ -60,17 +59,16 @@ to0Index := w -> (w / (i -> i-1)) Permutation = new Type of BasicList Permutation.synonym = "permutation" -isValidPermutation = method(TypicalValue => Boolean) -isValidPermutation List := Boolean => w -> (((sort w) == toList(1..#w)) and not (#w == 0)) - -new Permutation from BasicList := (typeofPermutation,w) -> ( - if not isValidPermutation(w) then error(toString w | " is not a valid permutation in one-line notation."); - w -) +new Permutation from BasicList := (typeofPermutation,w) -> w permutation = method(TypicalValue => Permutation) permutation List := Permutation => w -> new Permutation from w +isWellDefined Permutation := Boolean => w -> ( + wList := toList w; + ((sort wList) == toList(1..#wList)) and not (#wList == 0) +) + ------------------------------------ -- Permutation string representations ------------------------------------ diff --git a/M2/Macaulay2/packages/Permutations/docs.m2 b/M2/Macaulay2/packages/Permutations/docs.m2 index 00e7dd4d3ab..c99b67a73af 100644 --- a/M2/Macaulay2/packages/Permutations/docs.m2 +++ b/M2/Macaulay2/packages/Permutations/docs.m2 @@ -293,7 +293,7 @@ doc /// isDerangement isEven isOdd - isValidPermutation + isWellDefined isVexillary ord records @@ -1064,30 +1064,29 @@ doc /// sign /// --- isValidPermutation +-- isWellDefined doc /// Key - isValidPermutation - (isValidPermutation, List) + (isWellDefined, Permutation) Headline checks if a list is a valid permutation Usage - isValidPermutation w - isValidPermutation(w) + isWellDefined w + isWellDefined(w) Inputs - w:List + w:Permutation Outputs :Boolean Description Text - @TT "isValidPermutation p"@ determines if @TT "p"@ is a valid permutation. + @TT "isWellDefined p"@ determines if @TT "p"@ is a valid permutation. Permutations must be constructed from lists consisting of only the integers $1 \textemdash n$. If a list contains any other elements or does not consist of the entire range, then an error is thrown. Example - isValidPermutation {1, 2, 3} - isValidPermutation {0, 1, 2} - isValidPermutation {1, 1, 2} + isWellDefined permutation {1, 2, 3} + isWellDefined permutation {0, 1, 2} + isWellDefined permutation {1, 1, 2} /// -- isVexillary diff --git a/M2/Macaulay2/packages/Permutations/tests.m2 b/M2/Macaulay2/packages/Permutations/tests.m2 index cf72aaeefe8..ab20313c751 100644 --- a/M2/Macaulay2/packages/Permutations/tests.m2 +++ b/M2/Macaulay2/packages/Permutations/tests.m2 @@ -13,14 +13,14 @@ TEST /// -- Should expression, string, TeX, and HTML outputs be tested? -- valid permutations should be nonempty lists consisting of only all numbers 1..n - assert(isValidPermutation {1}) - assert(isValidPermutation toList (1..8)) - assert(isValidPermutation random toList (1..8)) - assert(not isValidPermutation {}) - assert(not isValidPermutation {0}) - assert(not isValidPermutation toList (0..8)) - assert(not isValidPermutation random toList (0..8)) - assert(not isValidPermutation {1,1,2}) + assert(isWellDefined permutation {1}) + assert(isWellDefined permutation toList (1..8)) + assert(isWellDefined permutation random toList (1..8)) + assert(not isWellDefined permutation {}) + assert(not isWellDefined permutation {0}) + assert(not isWellDefined permutation toList (0..8)) + assert(not isWellDefined permutation random toList (0..8)) + assert(not isWellDefined permutation {1,1,2}) /// TEST /// From 18274aff51500725689c182c4e34af82885c9eda Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Wed, 7 Aug 2024 21:28:02 -0500 Subject: [PATCH 011/226] Permutations inherit from VisibleList now --- M2/Macaulay2/packages/Permutations.m2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/Permutations.m2 b/M2/Macaulay2/packages/Permutations.m2 index 6a23d4c8fd5..7fb4435301a 100644 --- a/M2/Macaulay2/packages/Permutations.m2 +++ b/M2/Macaulay2/packages/Permutations.m2 @@ -56,10 +56,10 @@ to0Index := w -> (w / (i -> i-1)) ------------------------------------ -- Permutation type declarations and basic constructors ------------------------------------ -Permutation = new Type of BasicList +Permutation = new Type of VisibleList Permutation.synonym = "permutation" -new Permutation from BasicList := (typeofPermutation,w) -> w +new Permutation from VisibleList := (typeofPermutation,w) -> w permutation = method(TypicalValue => Permutation) permutation List := Permutation => w -> new Permutation from w From 2e22ca93578e766cb05334db9f51db403d5a606e Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Wed, 7 Aug 2024 21:39:10 -0500 Subject: [PATCH 012/226] Corrected TypicalValues use --- M2/Macaulay2/packages/Permutations.m2 | 51 +++++++++++++-------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/M2/Macaulay2/packages/Permutations.m2 b/M2/Macaulay2/packages/Permutations.m2 index 7fb4435301a..a0a927c4e99 100644 --- a/M2/Macaulay2/packages/Permutations.m2 +++ b/M2/Macaulay2/packages/Permutations.m2 @@ -61,7 +61,7 @@ Permutation.synonym = "permutation" new Permutation from VisibleList := (typeofPermutation,w) -> w -permutation = method(TypicalValue => Permutation) +permutation = method() permutation List := Permutation => w -> new Permutation from w isWellDefined Permutation := Boolean => w -> ( @@ -122,7 +122,7 @@ Permutation ^ ZZ := Permutation => (w, n) -> fold(if n < 0 then (-n):(permutatio ------------------------------------ -- some people prefer the transpose of this toMatrix = method(TypicalValue => Matrix) -toMatrix Permutation := Matrix => w -> ( +toMatrix Permutation := w -> ( id_(ZZ^(#w))_(to0Index toList w) ) @@ -145,7 +145,7 @@ Permutation * Matrix := Matrix => (w, M) -> ( -- Cycle decomposition of a permutation ------------------------------------ -- every permutation can be written as a product of disjoint cycles (in cycle notation) -cycleDecomposition = method(TypicalValue => List) +cycleDecomposition = method() cycleDecomposition Permutation := List => w -> ( w = to0Index toList w; cycles := {}; @@ -170,7 +170,7 @@ cycleDecomposition Permutation := List => w -> ( sort sortedCycles ) -cycleType = method(TypicalValue => Sequence) +cycleType = method() cycleType Permutation := Sequence => w -> ( toSequence rsort for cycle in cycleDecomposition w list #cycle ) @@ -179,17 +179,17 @@ cycleType Permutation := Sequence => w -> ( -- Ascents, descents, runs, exceedances, and records -- NOTE: All return the 1-indexed results for consistency with the permutation notation ------------------------------------ -ascents = method(TypicalValue => List) +ascents = method() ascents Permutation := List => w -> ( for i in 1 ..< #w list if w_i < w_(i+1) then i else continue ) -descents = method(TypicalValue => List) +descents = method() descents Permutation := List => w -> ( for i in 1 ..< #w list if w_i > w_(i+1) then i else continue ) -ascendingRuns = method(TypicalValue => List) +ascendingRuns = method() ascendingRuns Permutation := List => w -> ( -- inspired from the SageMath implementation -- https://github.com/sagemath/sage/blob/develop/src/sage/combinat/permutation.py @@ -209,7 +209,7 @@ ascendingRuns Permutation := List => w -> ( allRuns ) -descendingRuns = method(TypicalValue => List) +descendingRuns = method() descendingRuns Permutation := List => w -> ( -- inspired from the SageMath implementation -- https://github.com/sagemath/sage/blob/develop/src/sage/combinat/permutation.py @@ -229,19 +229,18 @@ descendingRuns Permutation := List => w -> ( allRuns ) -exceedances = method(TypicalValue => List, - Options => {Weak => false}) +exceedances = method(Options => {Weak => false}) exceedances Permutation := List => opts -> w -> ( compare := if opts.Weak then ((i,j) -> i <= j) else ((i,j) -> i < j); for i in 1 .. #w list if compare(i,w_i) then i else continue ) -saliances = method(TypicalValue => List) +saliances = method() saliances Permutation := List => w -> ( to1Index positions(1 .. #w, i -> all(i+1 .. #w, j -> w_i > w_j)) ) -records = method(TypicalValue => List) +records = method() records Permutation := List => w -> ( to1Index positions(1 .. #w, i -> all(1 ..< i, j -> w_j < w_i)) ) @@ -250,7 +249,7 @@ records Permutation := List => w -> ( -- Pattern avoidance ------------------------------------ avoidsPattern = method(TypicalValue => Boolean) -avoidsPattern (Permutation,List) := Boolean => (w, pattern) -> ( +avoidsPattern (Permutation,List) := (w, pattern) -> ( --assume permutation is pattern-avoiding, break if not true for idx in subsets(0 .. #w-1, #pattern) do { vals := w_(idx); @@ -263,17 +262,17 @@ avoidsPattern (Permutation,List) := Boolean => (w, pattern) -> ( ) avoidsPatterns = method(TypicalValue => Boolean) -avoidsPatterns (Permutation, List) := Boolean => (w, patterns) -> ( +avoidsPatterns (Permutation, List) := (w, patterns) -> ( all(patterns, pattern -> avoidsPattern(w, pattern)) ) isVexillary = method(TypicalValue => Boolean) -isVexillary Permutation := Boolean => (w) -> ( +isVexillary Permutation := (w) -> ( avoidsPattern(w, {2,1,4,3}) ) isCartwrightSturmfels = method(TypicalValue => Boolean) -isCartwrightSturmfels Permutation := Boolean => w -> ( +isCartwrightSturmfels Permutation := w -> ( patterns := {{1,2,5,4,3}, {1,3,2,5,4}, {1,3,5,2,4}, @@ -290,7 +289,7 @@ isCartwrightSturmfels Permutation := Boolean => w -> ( ) isCDG = method(TypicalValue => Boolean) -isCDG Permutation := Boolean => w -> ( +isCDG Permutation := w -> ( patterns := {{1,3,2,5,4}, {2,1,5,4,3}, {2,1,4,6,3,5}, @@ -306,7 +305,7 @@ isCDG Permutation := Boolean => w -> ( -- Foata's fundamental bijection ------------------------------------ -- see https://en.wikipedia.org/wiki/Permutation#Foata's_transition_lemma -foataBijection = method(TypicalValue => Permutation) +foataBijection = method() foataBijection Permutation := Permutation => w -> ( permutation splice cycleDecomposition w ) @@ -319,35 +318,35 @@ inverse Permutation := Permutation => w -> (permutation to1Index inversePermutat -- order of a permutation, i.e. smallest integer n such that w^n = identity -- the order of a permutation can be expressed as the lcm of its cycle lengths -ord = method(TypicalValue => ZZ) +ord = method() ord Permutation := ZZ => w -> ( lcm((cycleDecomposition w) / length) ) -- see https://en.wikipedia.org/wiki/Parity_of_a_permutation for different ways -- to compute the sign or parity of a permutation -sign = method(TypicalValue => ZZ) +sign = method() sign Permutation := ZZ => w -> ( if even(#w - #(cycleDecomposition w)) then 1 else -1 ) isEven = method(TypicalValue => Boolean) -isEven Permutation := Boolean => w -> ( +isEven Permutation := w -> ( sign w == 1 ) isOdd = method(TypicalValue => Boolean) -isOdd Permutation := Boolean => w -> ( +isOdd Permutation := w -> ( sign w == -1 ) isDerangement = method(TypicalValue => Boolean) -isDerangement Permutation := Boolean => w -> (not any(cycleDecomposition w, cycle -> #cycle == 1)) +isDerangement Permutation := w -> (not any(cycleDecomposition w, cycle -> #cycle == 1)) -fixedPoints = method(TypicalValue => List) -fixedPoints Permutation := Boolean => w -> (for cycle in cycleDecomposition w list if #cycle == 1 then unsequence cycle else continue) +fixedPoints = method() +fixedPoints Permutation := List => w -> (for cycle in cycleDecomposition w list if #cycle == 1 then unsequence cycle else continue) -inversions = method(TypicalValue => List) +inversions = method() inversions Permutation := List => w -> ( for idxPair in sort(subsets(toList w, 2) / sort) list if w_(idxPair#0) > w_(idxPair#1) then idxPair else continue ) From 11396850f9d3bbe84aae00dfdb0f77093e93c89e Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 4 Jun 2024 12:52:35 -0400 Subject: [PATCH 013/226] Add PR template with link to instructions Content is inside a comment so it won't appear after the PR is opened. [ci skip] --- .github/pull_request_template.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000000..3ad99033e21 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,5 @@ + From 1fd238210e9a37ddaec3b700ccd22f06ff5f28f5 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 4 Sep 2024 06:13:19 -0400 Subject: [PATCH 014/226] Remove libatomic_ops submodule --- .gitmodules | 3 --- M2/submodules/libatomic_ops | 1 - 2 files changed, 4 deletions(-) delete mode 160000 M2/submodules/libatomic_ops diff --git a/.gitmodules b/.gitmodules index cfb39772220..b46c025a806 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,9 +10,6 @@ [submodule "M2/submodules/bdwgc"] path = M2/submodules/bdwgc url = https://github.com/Macaulay2/bdwgc.git -[submodule "M2/submodules/libatomic_ops"] - path = M2/submodules/libatomic_ops - url = https://github.com/Macaulay2/libatomic_ops.git [submodule "M2/submodules/mpir"] path = M2/submodules/mpir url = https://github.com/Macaulay2/mpir.git diff --git a/M2/submodules/libatomic_ops b/M2/submodules/libatomic_ops deleted file mode 160000 index ba6c3170412..00000000000 --- a/M2/submodules/libatomic_ops +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ba6c3170412ef7f751ff63e2b656296265dcff93 From 24b5104714a6d3a24893ed28dd45a0fb77c140a2 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Fri, 9 Aug 2024 01:27:46 +0200 Subject: [PATCH 015/226] combined documentation of catch and throw --- .../packages/Macaulay2Doc/ov_language.m2 | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/ov_language.m2 b/M2/Macaulay2/packages/Macaulay2Doc/ov_language.m2 index a74937d7a60..702f964dff1 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/ov_language.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/ov_language.m2 @@ -606,18 +606,17 @@ document { }, SeeAlso => {"if", "then"} } -document { Key => "catch", - Headline => "catch a thrown exception", SeeAlso => {"throw"}, - Usage => "catch c", - Outputs => {{"the value obtained by evaluating the code ", TT "c", ", or, if a ", TO "throw", " was executed during the evaluation of ", TT "c", ", - the argument given to ", TO "throw", "."}}, - EXAMPLE lines /// - catch scan(0..10, i -> if i == 5 then throw 18 else print i) - ///} -document { Key => "throw", - Headline => "throw an exception", SeeAlso => {"catch"}, - Usage => "throw x", - Consequences => {{"the flow of control is passed to the surrounding ", TO "catch", ", and ", TT "x", " is returned as its value"}}, +document { + Key => {"throw", "catch"}, + Headline => "throw and catch exceptions", + Usage => "catch c\nthrow x", + Outputs => {{ + TT "catch", " returns the value obtained by evaluating the code ", TT "c", + ", or, if a ", TT "throw", " was executed during the evaluation of ", TT "c", + ", the argument given to ", TT "throw", "."}}, + Consequences => {{ + TT "throw", " passes the flow of control to the surrounding ", TT "catch", + ", and ", TT "x", " is returned as its value"}}, EXAMPLE lines /// catch scan(0..10, i -> if i == 5 then throw 18 else print i) ///} From 79c8dc06e58da5d5f1c29bfcc8741cc8ec130527 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Sat, 5 Oct 2024 00:30:03 +0200 Subject: [PATCH 016/226] fixed a typical value typo --- M2/Macaulay2/d/actors.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/d/actors.d b/M2/Macaulay2/d/actors.d index efc6dfd42b7..83f1b332640 100644 --- a/M2/Macaulay2/d/actors.d +++ b/M2/Macaulay2/d/actors.d @@ -331,7 +331,7 @@ export (lhs:Expr) * (rhs:Expr) : Expr := ( is null do buildErrorPacket(EngineError("monomial ideal multiplication failed")) ) else binarymethod(lhs,rhs,StarS)) - is x:RawMatrixCell do ( -- # typical value: symbol *, RawMatrix, RawRingElement, RawRingElement + is x:RawMatrixCell do ( -- # typical value: symbol *, RawMatrix, RawRingElement, RawMatrix when rhs is y:RawRingElementCell do ( when x.p*y.p From 9eb7a0c1bd4331d6ebf52b0ff8008f4f82062b19 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Sun, 6 Oct 2024 05:09:47 +0200 Subject: [PATCH 017/226] deleted duplicate code --- M2/Macaulay2/m2/modules.m2 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/M2/Macaulay2/m2/modules.m2 b/M2/Macaulay2/m2/modules.m2 index 3932f496b23..6c98e9b6d09 100644 --- a/M2/Macaulay2/m2/modules.m2 +++ b/M2/Macaulay2/m2/modules.m2 @@ -352,14 +352,6 @@ isSubset(Module, Module) := (M, N) -> ( ----------------------------------------------------------------------------- --- the key for issub hooks under GlobalHookStore -protect ContainmentHooks -issub = (f, g) -> f === g or ring f === ring g and tryHooks(ContainmentHooks, (f, g), - -- This is used by isSubset and for checking equality of ideals and modules. - -- Specialized strategies may be added as hooks, for instance for local rings. - -- TODO: how can do better in the homogeneous case? - (f, g) -> -1 === rawGBContains(raw gb g, raw f)) - -- used for sorting a list of modules Module ? Module := (M, N) -> if rank M != rank N then rank M ? rank N else degrees M ? degrees N From 6a592d5ce793ec2ac5bed612a836d44c880d75c1 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Sun, 6 Oct 2024 05:38:25 +0200 Subject: [PATCH 018/226] changed MonomialIdeal ^ ZZ to use BinaryPowerMethod --- M2/Macaulay2/m2/monideal.m2 | 2 +- M2/Macaulay2/tests/normal/monideal4.m2 | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/M2/Macaulay2/m2/monideal.m2 b/M2/Macaulay2/m2/monideal.m2 index 59b55295833..35fb9fd7804 100644 --- a/M2/Macaulay2/m2/monideal.m2 +++ b/M2/Macaulay2/m2/monideal.m2 @@ -34,7 +34,7 @@ monomialIdeal Sequence := v -> monomialIdeal toList v monomialIdeal RingElement := v -> monomialIdeal {v} MonomialIdeal#1 = I -> monomialIdeal 1_(ring I) -MonomialIdeal ^ ZZ := MonomialIdeal => (I, n) -> monomialIdeal (ideal I)^n +MonomialIdeal ^ ZZ := MonomialIdeal => BinaryPowerMethod MonomialIdeal ^ Array := MonomialIdeal => (I, e) -> monomialIdeal (ideal I)^e MonomialIdeal + MonomialIdeal := MonomialIdeal => ((I, J) -> newMonomialIdeal(ring I, raw I + raw J)) @@ samering diff --git a/M2/Macaulay2/tests/normal/monideal4.m2 b/M2/Macaulay2/tests/normal/monideal4.m2 index abf481ee140..94713fbb399 100644 --- a/M2/Macaulay2/tests/normal/monideal4.m2 +++ b/M2/Macaulay2/tests/normal/monideal4.m2 @@ -3,7 +3,12 @@ I = monomialIdeal(a^3,b^2*c,a*c*d) J = saturate(I,a) J1 = monomialIdeal(1_R) assert(J == monomialIdeal(1_R)) -end --- Local Variables: --- compile-command: "make -C $M2BUILDDIR/Macaulay2/packages/Macaulay2Doc/test monideal4.out" --- End: + +R = QQ[x_1..x_10] +I = monomialIdeal vars R +(t, J) = toSequence elapsedTiming I^6; +assert(t < 1 and instance(J, MonomialIdeal) and numgens J == 5005) +(t, K) = toSequence elapsedTiming saturate J; +assert(t < 1 and instance(K, MonomialIdeal) and K == 1) +(t, L) = toSequence elapsedTiming radical J; +assert(t < 1 and instance(L, MonomialIdeal) and L == I) From 4cc7c094774f849fd442b7d4bd54b3ae57978e8d Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Sat, 5 Oct 2024 01:13:32 +0200 Subject: [PATCH 019/226] removed dead code --- M2/Macaulay2/d/parse.d | 1 - M2/Macaulay2/d/parser.d | 24 ------------------------ 2 files changed, 25 deletions(-) diff --git a/M2/Macaulay2/d/parse.d b/M2/Macaulay2/d/parse.d index a5765f0acb0..daf87278af0 100644 --- a/M2/Macaulay2/d/parse.d +++ b/M2/Macaulay2/d/parse.d @@ -141,7 +141,6 @@ export LocalQuote := {+Operator:Token, rhs:Token, local:void}; export Binary := {+lhs:ParseTree, Operator:Token, rhs:ParseTree}; export Unary := {+Operator:Token, rhs:ParseTree}; export Postfix:= {+lhs:ParseTree, Operator:Token}; -export ArrayParseTree := array(ParseTree); export Parentheses := {+ left:Token, contents:ParseTree, right:Token }; export EmptyParentheses := {+ left:Token, right:Token }; export dummy := {+position:Position}; diff --git a/M2/Macaulay2/d/parser.d b/M2/Macaulay2/d/parser.d index ca1a23a7caf..98ca764320f 100644 --- a/M2/Macaulay2/d/parser.d +++ b/M2/Macaulay2/d/parser.d @@ -273,30 +273,6 @@ matcher(left:string):string := ( ); "" ); -export varexprlist := { - list:array(ParseTree), - size:int - }; -export newvarexprlist(i:int):varexprlist := varexprlist( - new array(ParseTree) len i do provide dummyTree, - 0); -needatleast(i:int,v:varexprlist):void := ( - if length(v.list) < i then ( - v.list = new array(ParseTree) len 2*i do ( - foreach e in v.list do provide e; - while true do provide dummyTree; - ); - ); - ); -export (v:varexprlist) << (e:ParseTree) : varexprlist := ( - needatleast(v.size + 1,v); - v.list.(v.size) = e; - v.size = v.size + 1; - v - ); -export toexprlist(v:varexprlist):ArrayParseTree := ( - new array(ParseTree) len v.size do foreach e in v.list do provide e - ); export unaryparen(left:Token,file:TokenFile,prec:int,obeylines:bool):ParseTree := ( rightparen := matcher(left.word.name); if rightparen == peektoken(file,false).word.name From 0c333011f16199db9ffac9b5d22d87b9d9e67a04 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 24 Jun 2024 22:54:05 -0500 Subject: [PATCH 020/226] added lift and promote for IndexedVariable --- M2/Macaulay2/m2/monoids.m2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/M2/Macaulay2/m2/monoids.m2 b/M2/Macaulay2/m2/monoids.m2 index 72cc963ef22..64b3a0a7adc 100644 --- a/M2/Macaulay2/m2/monoids.m2 +++ b/M2/Macaulay2/m2/monoids.m2 @@ -79,6 +79,7 @@ degree MonoidElement := m -> ( baseName MonoidElement := m -> if #(s := rawSparseListFormMonomial raw m) == 1 and s#0#1 == 1 then (class m).generatorSymbols#(s#0#0) else error "expected a generator" +promote(IndexedVariable, RingElement) := RingElement => (m, R) -> promote(value m, R) promote(MonoidElement, RingElement) := RingElement => (m, R) -> ( k := coefficientRing first flattenRing R; -- TODO: audit this code @@ -89,6 +90,7 @@ promote(MonoidElement, RingElement) := RingElement => (m, R) -> ( then new R from rawTerm(R.RawRing, raw 1_k, m.RawMonomial) else "expected monomial from same ring") +lift(IndexedVariable, MonoidElement) := MonoidElement => (m, M) -> lift(value m, M) lift(RingElement, MonoidElement) := MonoidElement => (m, M) -> ( k := coefficientRing first flattenRing(R := ring m); if instance(m, monoid k) From 54ed1716ad695a9bc422c9d913dad0161f31df89 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 26 Aug 2024 10:41:20 -0400 Subject: [PATCH 021/226] Add finite limit to virtual memory used when checking msolve Rather than allowing unlimited virtual memory, we increase the upper bound to 1.5 GB, which should still allow all the tests to pass. --- M2/libraries/msolve/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/libraries/msolve/Makefile.in b/M2/libraries/msolve/Makefile.in index 622a97a390d..0ca1c8fd14a 100644 --- a/M2/libraries/msolve/Makefile.in +++ b/M2/libraries/msolve/Makefile.in @@ -6,7 +6,7 @@ LICENSEFILES = README.md COPYING PRECONFIGURE = ./autogen.sh -VLIMIT = unlimited +VLIMIT = 1500000 include ../Makefile.library Makefile: @srcdir@/Makefile.in ; cd ../.. && ./config.status libraries/msolve/Makefile From d7f70e6d69a86cb0f10fcd893fd671248eab3f6f Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 9 Sep 2024 15:41:12 -0400 Subject: [PATCH 022/226] Add CHECK_NMZ_PACKAGE autoconf macro for checking libnormaliz macros Use it for the e-antic check --- M2/configure.ac | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/M2/configure.ac b/M2/configure.ac index ec042e15520..bab03a89edf 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -1021,6 +1021,19 @@ else AC_MSG_RESULT([no, will build]) BUILD_csdp=yes fi +AC_DEFUN([CHECK_NMZ_PACKAGE], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([ + #include + ], [ + #ifdef $1 + return 0; + #else + return 1; + #endif + ])], + [LIBS="$LIBS $2"])]) + AS_IF([test $BUILD_normaliz = no], [AC_MSG_CHECKING(whether the package normaliz is installed) AS_IF([command -v normaliz > /dev/null], @@ -1031,18 +1044,7 @@ AS_IF([test $BUILD_normaliz = no], AC_LANG(C++) SAVELIBS=$LIBS LIBS="$LIBS -lnormaliz -lnauty -lgmp" - dnl check if libnormaliz built w/ eantic - AC_RUN_IFELSE( - [AC_LANG_PROGRAM([ - #include - ], [ - #ifdef ENFNORMALIZ - return 0; - #else - return 1; - #endif - ])], - [LIBS="$LIBS -leantic -leanticxx"]) + CHECK_NMZ_PACKAGE([ENFNORMALIZ], [-leantic -leanticxx]) AC_LINK_IFELSE( [AC_LANG_PROGRAM([ #include From 75426c187b2db3e528a4be7a54708210d9c88ed4 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 9 Sep 2024 15:42:16 -0400 Subject: [PATCH 023/226] Add check to see if libnormaliz needs to link against CoCoA --- M2/configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/M2/configure.ac b/M2/configure.ac index bab03a89edf..a7a31113371 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -1045,6 +1045,7 @@ AS_IF([test $BUILD_normaliz = no], SAVELIBS=$LIBS LIBS="$LIBS -lnormaliz -lnauty -lgmp" CHECK_NMZ_PACKAGE([ENFNORMALIZ], [-leantic -leanticxx]) + CHECK_NMZ_PACKAGE([NMZ_COCOA], [-lcocoa]) AC_LINK_IFELSE( [AC_LANG_PROGRAM([ #include From 6d7cdea8fe56a4e469489d064d87eda247e81399 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 9 Sep 2024 15:51:21 -0400 Subject: [PATCH 024/226] Use new CHECK_NMZ_MACRO to check if we need to link against nauty Previously, we always linked against nauty, but it might not be necessary if libnormaliz was built w/o the nauty package --- M2/configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/M2/configure.ac b/M2/configure.ac index a7a31113371..6842948b4ef 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -1043,9 +1043,10 @@ AS_IF([test $BUILD_normaliz = no], AC_MSG_CHECKING([for libnormaliz]) AC_LANG(C++) SAVELIBS=$LIBS - LIBS="$LIBS -lnormaliz -lnauty -lgmp" + LIBS="$LIBS -lnormaliz -lgmp" CHECK_NMZ_PACKAGE([ENFNORMALIZ], [-leantic -leanticxx]) CHECK_NMZ_PACKAGE([NMZ_COCOA], [-lcocoa]) + CHECK_NMZ_PACKAGE([NMZ_NAUTY], [-lnauty]) AC_LINK_IFELSE( [AC_LANG_PROGRAM([ #include From 99d8918e53e01c98264e6f0718ba1ef3587ccb14 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 10 Sep 2024 16:46:33 -0400 Subject: [PATCH 025/226] Regenerate configure script when building mpsolve (autotools) The configure script shipped in the tarball tries to run aclocal-1.16, but automake 1.17 was recently released and 1.16 is no longer available on some systems (e.g., Arch Linux). [ci skip] --- M2/libraries/mpsolve/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/M2/libraries/mpsolve/Makefile.in b/M2/libraries/mpsolve/Makefile.in index cb06afc7194..50d891376d4 100644 --- a/M2/libraries/mpsolve/Makefile.in +++ b/M2/libraries/mpsolve/Makefile.in @@ -15,6 +15,8 @@ LICENSEFILES = README # their use of libtool prevents this from working -- somehow "make install" rebuilds mpsolve during the installation, after we strip it # STRIPFILES = src/mpsolve/mpsolve +PRECONFIGURE = autoreconf -fvi + INSTALLTARGET = install-strip CONFIGOPTIONS += --disable-shared \ --disable-dependency-tracking \ From cd97123d68988c3cd607e0ac4b65eae5873603de Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 14 Oct 2024 07:17:22 -0400 Subject: [PATCH 026/226] Bump msolve to 0.7.3 --- M2/cmake/build-libraries.cmake | 4 ++-- M2/libraries/msolve/Makefile.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/M2/cmake/build-libraries.cmake b/M2/cmake/build-libraries.cmake index 39ab529fe0f..311dde5fc20 100644 --- a/M2/cmake/build-libraries.cmake +++ b/M2/cmake/build-libraries.cmake @@ -484,8 +484,8 @@ endif() # https://github.com/algebraic-solving/msolve ExternalProject_Add(build-msolve - URL https://github.com/algebraic-solving/msolve/archive/refs/tags/v0.7.2.tar.gz - URL_HASH SHA256=a834283700921051c9a8c93c07498d1a247e2b17bf32b01c01bfe9f80b0075b8 + URL https://github.com/algebraic-solving/msolve/archive/refs/tags/v0.7.3.tar.gz + URL_HASH SHA256=b82bf7dfe1fb7d3064ecf95e0d0a01334820b09b1107368ca9b4d05ba9ee1241 PREFIX libraries/msolve SOURCE_DIR libraries/msolve/build DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/BUILD/tarfiles diff --git a/M2/libraries/msolve/Makefile.in b/M2/libraries/msolve/Makefile.in index 0ca1c8fd14a..6ee49aa5aa3 100644 --- a/M2/libraries/msolve/Makefile.in +++ b/M2/libraries/msolve/Makefile.in @@ -1,5 +1,5 @@ HOMEPAGE = https://msolve.lip6.fr/ -VERSION = 0.7.2 +VERSION = 0.7.3 URL = https://github.com/algebraic-solving/msolve/archive/refs/tags TARFILE = v$(VERSION).tar.gz LICENSEFILES = README.md COPYING From 2c211cd4bff9749113166d55c87094c9557a55b8 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 15 Sep 2024 07:10:26 -0400 Subject: [PATCH 027/226] Turn on building w/ Python support by default --- M2/cmake/configure.cmake | 3 +-- M2/configure.ac | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/M2/cmake/configure.cmake b/M2/cmake/configure.cmake index 70bbf4f7712..e2fb1a06306 100644 --- a/M2/cmake/configure.cmake +++ b/M2/cmake/configure.cmake @@ -30,8 +30,7 @@ option(WITH_TBB "Link with the TBB library" ON) option(WITH_FFI "Link with the FFI library" ON) # TODO: parse.d expr.d tokens.d actors4.d actors5.d still need xml option(WITH_XML "Link with the libxml2 library" ON) -# TODO: still not operational -option(WITH_PYTHON "Link with the Python library" OFF) +option(WITH_PYTHON "Link with the Python library" ON) option(WITH_MYSQL "Link with the MySQL library" OFF) set(BUILD_PROGRAMS "" CACHE STRING "Build programs, even if found") diff --git a/M2/configure.ac b/M2/configure.ac index 6842948b4ef..b900ae8ca6b 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -1328,10 +1328,13 @@ else fi AC_SUBST(GTEST_PATH) -AC_SUBST(PYTHON,no) +AC_SUBST([PYTHON]) AC_ARG_WITH(python, AS_HELP_STRING(--with-python@<:@=3.x@:>@., [link with libpython. If the version number is not specified, then the - system's default version will be detected.]), PYTHON=$withval) + system's default version will be detected. Use --without-python to turn + off Python support.]), + [PYTHON=$withval], + [PYTHON=yes]) if test $PYTHON != no then AC_DEFINE(WITH_PYTHON,1,[whether we are linking with the python library]) if test $PYTHON = yes From 10ebfbed495b5f8c52788963fc6bf03314f2cded Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 7 Oct 2024 17:40:44 -0400 Subject: [PATCH 028/226] Remove "with Python support" config options for GitHub builds It's now the default --- .github/workflows/test_build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test_build.yml b/.github/workflows/test_build.yml index 5b171ec73f4..bd9b41dc0e2 100644 --- a/.github/workflows/test_build.yml +++ b/.github/workflows/test_build.yml @@ -130,7 +130,6 @@ jobs: -DCMAKE_BUILD_TYPE=Release -DBUILD_NATIVE=OFF \ -DCMAKE_PREFIX_PATH="`brew --prefix`;`brew --prefix libffi`" \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DWITH_PYTHON=ON \ --debug-trycompile - name: Build libraries using Ninja @@ -161,7 +160,7 @@ jobs: export CPPFLAGS="-I`brew --prefix`/include -I`brew --prefix libomp`/include" export LDFLAGS="-L`brew --prefix`/lib -L`brew --prefix libomp`/lib \ -L/Library/Frameworks/Python.framework/Versions/${PYVERSION}/lib" - ../../configure --enable-download --with-python --with-system-gc + ../../configure --enable-download --with-system-gc - name: Build Macaulay2 using Make if: matrix.build-system == 'autotools' From 65645d0b4743546bb6b007a286a98b8955127733 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Sun, 7 Jul 2024 18:23:00 -0500 Subject: [PATCH 029/226] added helper routine inducedBasisMap --- M2/Macaulay2/m2/basis.m2 | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/M2/Macaulay2/m2/basis.m2 b/M2/Macaulay2/m2/basis.m2 index 6cbdbafe191..faae0c582da 100644 --- a/M2/Macaulay2/m2/basis.m2 +++ b/M2/Macaulay2/m2/basis.m2 @@ -173,6 +173,18 @@ basis(ZZ, ZZ, Ring) := opts -> (lo, hi, R) -> basis(lo, ----------------------------------------------------------------------------- +inducedBasisMap = (G, F, f) -> ( + -- Assumes G = image basis(deg, target f) and F = image basis(deg, source f) + -- this helper routine is useful for computing basis of a pair of composable + -- matrices or a chain complex, when target f is the source of a matrix which + -- we previously computed basis for. + psi := f * inducedMap(source f, , generators F); + phi := last coefficients(ambient psi, Monomials => generators G); + map(G, F, phi, Degree => degree f)) + -- TODO: benchmark against inducedTruncationMap in Truncations.m2 + -- f' := f * inducedMap(source f, F) * inducedMap(F, source generators F, generators F); + -- map(G, F, inducedMap(G, source f', f') // inducedMap(G, source generators G, generators G), Degree => degree f)) + basis(List, Matrix) := basis(ZZ, Matrix) := opts -> (deg, M) -> basis(deg, deg, M, opts) basis(InfiniteNumber, InfiniteNumber, Matrix) := @@ -183,12 +195,8 @@ basis(List, List, Matrix) := basis(List, ZZ, Matrix) := basis(ZZ, InfiniteNumber, Matrix) := basis(ZZ, List, Matrix) := -basis(ZZ, ZZ, Matrix) := opts -> (lo, hi, M) -> ( - BF := basis(lo, hi, target M, opts); - BG := basis(lo, hi, source M, opts); - -- TODO: is this general enough? - BM := last coefficients(matrix (M * BG), Monomials => BF); - map(image BF, image BG, BM)) +basis(ZZ, ZZ, Matrix) := opts -> (lo, hi, M) -> inducedBasisMap( + image basis(lo, hi, target M, opts), image basis(lo, hi, source M, opts), M) ----------------------------------------------------------------------------- From 5e99ba9d6e43561adc4411a00031225754946aa6 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Tue, 1 Mar 2022 04:15:43 -0600 Subject: [PATCH 030/226] added helper routine inducedTruncationMap --- M2/Macaulay2/packages/Truncations.m2 | 14 +++++++++----- M2/Macaulay2/packages/Truncations/tests.m2 | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/M2/Macaulay2/packages/Truncations.m2 b/M2/Macaulay2/packages/Truncations.m2 index c3b3e44f732..1ebb8b9032f 100644 --- a/M2/Macaulay2/packages/Truncations.m2 +++ b/M2/Macaulay2/packages/Truncations.m2 @@ -260,12 +260,16 @@ truncate(List, Module) := Module => truncateModuleOpts >> opts -> (degs, M) -> ( -------------------------------------------------------------------- +inducedTruncationMap = (G, F, f) -> ( + -- Assumes G = truncate(deg, target f) and F = truncate(deg, source f) + -- this helper routine is useful for truncating complexes or a pair of + -- composable matrices, when target f is the source of a previously + -- truncated matrix, so we have truncated it once already. + f' := f * inducedMap(source f, F) * inducedMap(F, source gens F, gens F); + map(G, F, inducedMap(G, source f', f') // inducedMap(G, source gens G, gens G))) + truncate(List, Matrix) := Matrix => truncateModuleOpts >> opts -> (degs, f) -> ( - F := truncate(degs, source f, opts); - G := truncate(degs, target f, opts); - -- FIXME, what is right? - fgenF := (f * inducedMap(source f, F) * inducedMap(F, source gens F, gens F)); - map(G, F, inducedMap(G, source fgenF, fgenF) // inducedMap(G, source gens G, gens G))) + inducedTruncationMap(truncate(degs, target f, opts), truncate(degs, source f, opts), f)) -------------------------------------------------------------------- diff --git a/M2/Macaulay2/packages/Truncations/tests.m2 b/M2/Macaulay2/packages/Truncations/tests.m2 index ee93389d961..93b9bc72c79 100644 --- a/M2/Macaulay2/packages/Truncations/tests.m2 +++ b/M2/Macaulay2/packages/Truncations/tests.m2 @@ -358,6 +358,20 @@ TEST /// -- test of truncationPolyhedron with Nef option assert(HH_0 D == M1 and HH_1 D == 0 and HH_2 D == 0) -- good, fixed in v1.0 /// +TEST /// -- test of inducedTruncationMap + debug needsPackage "Truncations" + S = QQ[x,y,z] + gbTrace = 2 + M = image map(S^3, , {{x}, {y}, {z}}) + f = inducedMap(S^3, M) + (tar, src) = (truncate(2, S^3), truncate(2, M)) + g = inducedTruncationMap(tar, src, f) + assert isWellDefined g + assert(g === truncate(2, f)) + assert(tar === target g) + assert(src === source g) +/// + end-- restart From 44769c465f296d2da8504c9f6adf0ef86c977070 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 12:50:06 -0500 Subject: [PATCH 031/226] added tests for a tricky example --- M2/Macaulay2/tests/normal/basis3.m2 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/M2/Macaulay2/tests/normal/basis3.m2 b/M2/Macaulay2/tests/normal/basis3.m2 index 250f530048e..1bd538e010e 100644 --- a/M2/Macaulay2/tests/normal/basis3.m2 +++ b/M2/Macaulay2/tests/normal/basis3.m2 @@ -13,6 +13,16 @@ assert(basis(0, 1, R) == matrix{{1, a, b}}) assert(basis(0, 2, R) == matrix{{1, a, a^2, a*b, b, b^2}}) assert(basis(0, 1, R) == matrix{{1, a, b}}) +-- c.f. examples "part(List,Complex)" +R = QQ[a..d] +M = coker matrix {{a*b, a*c, b*c, a*d}} +N = image map(R^{4:-2}, , {{-c, -c, 0, -d}, {b, 0, -d, 0}, {0, a, 0, 0}, {0, 0, c, b}}) +P = image map(R^{4:-3}, , {{d}, {0}, {-c}, {b}}) +assert(basis(4, map(R^0, M, 0)) == 0) +assert(basis(4, map(M, N, 0)) == 0) +assert(basis(4, map(N, P, 0)) == 0) +assert(basis(4, map(P, R^0, 0)) == 0) + -- partial multidegrees -- see https://github.com/Macaulay2/M2/pull/2056 assert(basis({3}, A = ZZ/101[a..d, Degrees=>{2:{1,2},2:{0,1}}]) == matrix"a3,a2b,ab2,b3") From 82df5fe0c63ab756c12090536e7971bcaa7d5b61 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Thu, 4 Jul 2024 11:13:54 -0500 Subject: [PATCH 032/226] added basis of a matrix of finite length modules --- M2/Macaulay2/m2/basis.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/m2/basis.m2 b/M2/Macaulay2/m2/basis.m2 index faae0c582da..c3c3979b7f2 100644 --- a/M2/Macaulay2/m2/basis.m2 +++ b/M2/Macaulay2/m2/basis.m2 @@ -127,7 +127,7 @@ basis = method(TypicalValue => Matrix, basis Module := opts -> M -> basis(-infinity, infinity, M, opts) basis Ideal := opts -> I -> basis(module I, opts) basis Ring := opts -> R -> basis(module R, opts) --- TODO: add? basis Matrix := opts -> m -> basis(-infinity, infinity, m, opts) +basis Matrix := opts -> m -> basis(-infinity, infinity, m, opts) ----------------------------------------------------------------------------- From 39455fe9f64f3c1453edcfdfa4a0dcf357a003de Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 10:36:44 -0500 Subject: [PATCH 033/226] added tests and docs for basis Matrix --- M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 | 1 + M2/Macaulay2/tests/normal/basis3.m2 | 1 + 2 files changed, 2 insertions(+) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 index d2cebc905d8..505f668f12f 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 @@ -30,6 +30,7 @@ doc /// (basis, List, ZZ, Matrix) (basis, List, ZZ, Module) (basis, List, ZZ, Ring) + (basis, Matrix) (basis, Module) (basis, Ring) (basis, ZZ, Ideal) diff --git a/M2/Macaulay2/tests/normal/basis3.m2 b/M2/Macaulay2/tests/normal/basis3.m2 index 1bd538e010e..89cacd167ed 100644 --- a/M2/Macaulay2/tests/normal/basis3.m2 +++ b/M2/Macaulay2/tests/normal/basis3.m2 @@ -69,6 +69,7 @@ assert(basis(0, A = ZZ/101[a, Degrees => {0}]) == gens A^1) -- this is finite over the field, so we include all vars assert(basis(0, A = ZZ/101[a, Degrees => {0}]/ideal(a^3)) == matrix"1,a,a2") assert(basis A == matrix"1,a,a2") +assert(basis id_(A^1) == id_(image basis A)) -- https://github.com/Macaulay2/M2/issues/1312 R = QQ[] From 36107ac133a1ba81d9db0dc1d018606b2c1e500c Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 02:53:09 -0500 Subject: [PATCH 034/226] fixed a bug in basis of tower rings --- M2/Macaulay2/m2/basis.m2 | 3 ++- M2/Macaulay2/tests/normal/basis3.m2 | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/m2/basis.m2 b/M2/Macaulay2/m2/basis.m2 index c3c3979b7f2..c60b5b3a51a 100644 --- a/M2/Macaulay2/m2/basis.m2 +++ b/M2/Macaulay2/m2/basis.m2 @@ -29,7 +29,8 @@ inf := t -> if t === infinity then -1 else t -- the output of this is used in BasisContext getVarlist = (R, varlist) -> ( - if varlist === null then toList(0 .. numgens R - 1) + numvars := R.numallvars ?? numgens R; + if varlist === null then toList(0 .. numvars - 1) else if instance(varlist, List) then apply(varlist, v -> -- TODO: what if R = ZZ? if instance(v, R) then index v else diff --git a/M2/Macaulay2/tests/normal/basis3.m2 b/M2/Macaulay2/tests/normal/basis3.m2 index 89cacd167ed..9ffb3073545 100644 --- a/M2/Macaulay2/tests/normal/basis3.m2 +++ b/M2/Macaulay2/tests/normal/basis3.m2 @@ -57,6 +57,11 @@ assert(basis(0, R) == gens R^1) -- ignores degree 0 vars assert try (basis(0, R, Variables => {0}); false) else true assert(basis(1, R) == 0) +S = ZZ/101[s,t] +R = S[a..d] +assert(basis({0,1}, R) == sub(vars S, R)) +assert(basis({1,0}, R) == vars R) + -- FIXME: these are also broken R = ZZ/101[a,b, Degrees => {0,1}] basis(1, R) From 0c1e126de372a8c8e0b7a0902bacb9cb925aa590 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 10:04:56 -0500 Subject: [PATCH 035/226] changed a line in documentation of basis --- M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 index 505f668f12f..90912b03b50 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 @@ -146,7 +146,8 @@ doc /// Example A = ZZ/101[a..d]; B = A[x,y]/(a*x, x^2, y^2); - basis B + try basis B + basis(B, Variables => B_*) Text If $M$ is an ideal or module, the resulting map looks somewhat strange, since maps between modules are given from generators, in terms of the generators of the target module. Use @TO super@ or @TO cover@ From 233a74ae9743777c72ff1a474577d5b347d5d1f2 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Thu, 4 Jul 2024 11:21:22 -0500 Subject: [PATCH 036/226] added basis for ring map of Artinian rings --- M2/Macaulay2/m2/basis.m2 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/M2/Macaulay2/m2/basis.m2 b/M2/Macaulay2/m2/basis.m2 index c60b5b3a51a..ff4c6c5dd50 100644 --- a/M2/Macaulay2/m2/basis.m2 +++ b/M2/Macaulay2/m2/basis.m2 @@ -201,6 +201,26 @@ basis(ZZ, ZZ, Matrix) := opts -> (lo, hi, M) -> inducedB ----------------------------------------------------------------------------- +-- Note: f needs to be homogeneous, otherwise returns nonsense +basis RingMap := Matrix => opts -> f -> basis(({}, {}), f, opts) +basis(ZZ, RingMap) := +basis(List, RingMap) := Matrix => opts -> (degs, f) -> basis((degs, degs), f, opts) +basis(Sequence, RingMap) := Matrix => opts -> (degs, f) -> ( + -- if not isHomogeneous f then error "expected a graded ring map (try providing a DegreeMap)"; + if #degs != 2 then error "expected a sequence (tardeg, srcdeg) of degrees for target and source rings"; + (T, S) := (target f, source f); + (tardeg, srcdeg) := degs; + if tardeg === null then tardeg = f.cache.DegreeMap srcdeg; + if srcdeg === null then srcdeg = f.cache.DegreeLift tardeg; + targens := basis(tardeg, tardeg, T); + srcgens := basis(srcdeg, srcdeg, S); + -- TODO: should matrix RingMap return this map instead? + -- mon := map(module T, image matrix(S, { S.FlatMonoid_* }), f, matrix f) + mat := last coefficients(f cover srcgens, Monomials => targens); + map(image targens, image srcgens, f, mat)) + +----------------------------------------------------------------------------- + basisHelper = (opts, lo, hi, M) -> ( R := ring M; n := degreeLength R; From 14b937a20d62007577c247e572b3b7875065f65b Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 10:55:00 -0500 Subject: [PATCH 037/226] added tests and docs for basis RingMap --- .../Macaulay2Doc/functions/basis-doc.m2 | 4 ++++ M2/Macaulay2/tests/normal/basis3.m2 | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 index 90912b03b50..c85b841b7a2 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/basis-doc.m2 @@ -26,6 +26,7 @@ doc /// (basis, List, Matrix) (basis, List, Module) (basis, List, Ring) + (basis, List, RingMap) (basis, List, ZZ, Ideal) (basis, List, ZZ, Matrix) (basis, List, ZZ, Module) @@ -33,6 +34,8 @@ doc /// (basis, Matrix) (basis, Module) (basis, Ring) + (basis, RingMap) + (basis, Sequence, RingMap) (basis, ZZ, Ideal) (basis, ZZ, InfiniteNumber, Ideal) (basis, ZZ, InfiniteNumber, Matrix) @@ -45,6 +48,7 @@ doc /// (basis, ZZ, Matrix) (basis, ZZ, Module) (basis, ZZ, Ring) + (basis, ZZ, RingMap) (basis, ZZ, ZZ, Ideal) (basis, ZZ, ZZ, Matrix) (basis, ZZ, ZZ, Module) diff --git a/M2/Macaulay2/tests/normal/basis3.m2 b/M2/Macaulay2/tests/normal/basis3.m2 index 9ffb3073545..ba7bb575521 100644 --- a/M2/Macaulay2/tests/normal/basis3.m2 +++ b/M2/Macaulay2/tests/normal/basis3.m2 @@ -75,6 +75,11 @@ assert(basis(0, A = ZZ/101[a, Degrees => {0}]) == gens A^1) assert(basis(0, A = ZZ/101[a, Degrees => {0}]/ideal(a^3)) == matrix"1,a,a2") assert(basis A == matrix"1,a,a2") assert(basis id_(A^1) == id_(image basis A)) +assert(basis map(A,A) == id_(image basis A)) + +A = quotient ideal conwayPolynomial(2, 3) +B = image basis A +assert(basis map(A, A, {a^2}) == map(B, B, {{1, 0, 0}, {0, 0, 1}, {0, 1, 1}})) -- https://github.com/Macaulay2/M2/issues/1312 R = QQ[] @@ -126,3 +131,16 @@ assert(basis(2, R) == matrix"a2,b") -- FIXME: assert(basis(2, R, Truncate => true) == matrix "b,a2,c") assert(basis(2, R) == matrix"a2,b") +-- tests for basis of ring maps +R = ZZ/32003[s,t][a..d] +f = map(A := coefficientRing R, R, DegreeMap => d -> take(d, - degreeLength A)) +assert(entries basis(({2}, {0,2}), f) == entries id_(ZZ^3)) + +f = map(QQ[s,t], QQ[w,x,y,z], matrix"s3,s2t,st2,t3") +b = basis((6, 2), f) +-- FIXME: this is very non-minimal, but ker b doesn't work if f is homogeneous ... +K = image map(source b, , gens ker b) +-- FIXME: why isn't ker b a submodule of source b already? +-- assert isSubset(ker b, source b) +assert isSubset(K, source b) +assert(ker f == K) From 344ad6d17273ad23fc86196a3b76831d06c1e477 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 11:08:08 -0500 Subject: [PATCH 038/226] fixed a basis computation in PushForward --- M2/Macaulay2/packages/PushForward.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/PushForward.m2 b/M2/Macaulay2/packages/PushForward.m2 index 3f28b0dcb77..8cfd2e0cfcd 100644 --- a/M2/Macaulay2/packages/PushForward.m2 +++ b/M2/Macaulay2/packages/PushForward.m2 @@ -214,7 +214,7 @@ pushAuxHgs(RingMap):=(f)-> ( if isInclusionOfCoefficientRing f then ( --case when the source of f is the coefficient ring of the target: if not isModuleFinite target f then error "expected a finite map"; - matB = basis B; + matB = basis(B, Variables => 0 .. numgens B - 1); mapf = if isHomogeneous f then (b) -> ( (mons,cfs) := coefficients(b,Monomials=>matB); From f984fb1a7366ff920195509bcc6884d99110e931 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 11:14:57 -0500 Subject: [PATCH 039/226] fixed a basis computation in Schubert2 --- M2/Macaulay2/packages/Schubert2.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/Schubert2.m2 b/M2/Macaulay2/packages/Schubert2.m2 index e5a544d5eae..7cfbb4eca23 100644 --- a/M2/Macaulay2/packages/Schubert2.m2 +++ b/M2/Macaulay2/packages/Schubert2.m2 @@ -1767,7 +1767,7 @@ schubertRing(FlagBundle) := G -> ( (k,q) := toSequence(G.BundleRanks); P := diagrams(q,k); M := apply(P, i-> schubertCycle(i,G)); - E := flatten entries basis(R); + E := flatten entries basis(R, Variables => 0 .. numgens R - 1); local T'; T := transpose matrix apply (M, i -> apply(E, j-> coefficient(j,i))); --matrix converting from schu-basis --to h-basis From 1a667f2dd4f5564ea4db32e84f545911abd63fdc Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 13:45:55 -0500 Subject: [PATCH 040/226] fixup a basis computation in DGAlgebras --- M2/Macaulay2/packages/DGAlgebras.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/DGAlgebras.m2 b/M2/Macaulay2/packages/DGAlgebras.m2 index 1df859be618..2980b846230 100644 --- a/M2/Macaulay2/packages/DGAlgebras.m2 +++ b/M2/Macaulay2/packages/DGAlgebras.m2 @@ -203,7 +203,7 @@ getBasis (ZZ,DGAlgebra) := opts -> (homDegree,A) -> getBasis(homDegree,A.natural getBasis (ZZ,Ring) := opts -> (homDegree,R) -> ( local retVal; myMap := map(R, R.cache.basisAlgebra); - tempList := (flatten entries basis(homDegree, R.cache.basisAlgebra, Limit => opts.Limit)) / myMap; + tempList := (flatten entries basis(homDegree, R.cache.basisAlgebra, Limit => opts.Limit, Variables => 0 .. numgens R-1)) / myMap; if tempList == {} then retVal = map((R)^1,(R)^0, 0) else ( -- move this to an assert? From 0d45168abf371a81a8dbd798022d2fbd492e9126 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 15:01:53 -0500 Subject: [PATCH 041/226] fixed a basis computation in Book3264Examples --- M2/Macaulay2/packages/Book3264Examples.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/Book3264Examples.m2 b/M2/Macaulay2/packages/Book3264Examples.m2 index 5bf2b41553e..cba9a34944d 100644 --- a/M2/Macaulay2/packages/Book3264Examples.m2 +++ b/M2/Macaulay2/packages/Book3264Examples.m2 @@ -64,7 +64,7 @@ placeholderToSchubertBasis(RingElement,FlagBundle) := (c,G) -> ( (k,q) := toSequence(G.BundleRanks); P := diagrams(q,k); M := apply(P, i-> placeholderSchubertCycle(i,G)); - E := flatten entries basis(R); + E := flatten entries basis(R, Variables => 0 .. numgens R - 1); local T'; if R.cache.?htoschubert then T' = R.cache.htoschubert else ( T := transpose matrix apply (M, i -> apply(E, j-> coefficient(j,i))); --matrix converting from schu-basis From 0363edc09a390ce16a57102ec4e9f439f5afc556 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 21:31:32 -0500 Subject: [PATCH 042/226] fixed a basis computation in GradedLieAlgebras --- M2/Macaulay2/packages/GradedLieAlgebras.m2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/GradedLieAlgebras.m2 b/M2/Macaulay2/packages/GradedLieAlgebras.m2 index f5cf18aeecd..1611b97c8a9 100644 --- a/M2/Macaulay2/packages/GradedLieAlgebras.m2 +++ b/M2/Macaulay2/packages/GradedLieAlgebras.m2 @@ -2787,7 +2787,8 @@ basToMat(ZZ,List,LieAlgebra):=(d,m,L)->( basToMat(ZZ,ZZ,List,LieAlgebra):=(d,j,m,L)->( if m==={} or L#cache.dim#d==0 then matrix{{0_(L#Field)}} else ( - idm:=entries (basis((L#Field)^(dim(d,j,L)))); + F := L#Field; + idm := entries basis(F^(dim(d,j,L)), Variables => F_*); transpose matrix apply(m, x->if x==0 then flatten table(1,dim(d,j,L),x->0_(L#Field)) else sum( From d5db4099f70ef57465b6d430cbc27b39f88c46a9 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 21:32:18 -0500 Subject: [PATCH 043/226] fixed a basis computation in PushForward --- M2/Macaulay2/packages/PushForward.m2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/packages/PushForward.m2 b/M2/Macaulay2/packages/PushForward.m2 index 8cfd2e0cfcd..bdd385206c9 100644 --- a/M2/Macaulay2/packages/PushForward.m2 +++ b/M2/Macaulay2/packages/PushForward.m2 @@ -775,7 +775,7 @@ TEST/// L = A[symbol b, symbol c, Join => false]/(b*c-s*t, t*b^2-s*c^2, b^3-s*c^2, c^3 - t*b^2) isHomogeneous L describe L - basis L + basis(L, Variables => L_*) inc = map(L, A) assert isInclusionOfCoefficientRing inc assert isModuleFinite L @@ -796,7 +796,7 @@ TEST/// L = A[symbol b, symbol c, Join => false]/(b*c-s*t,c^3-b*t^2,s*c^2-b^2*t,b^3-s^2*c) isHomogeneous L describe L - basis L + basis(L, Variables => L_*) inc = map(L, A) assert isInclusionOfCoefficientRing inc assert isModuleFinite L @@ -837,7 +837,7 @@ TEST/// assert((M1,B1) == (M,B)) assert(pushFwd matrix{{y}} == pushFwd(map(R,A),matrix{{y}})) assert(isFreeModule M and rank M == 7) - assert(B == basis R) + assert(B == basis(R, Variables => R_*)) assert( pf(y+x)- matrix {{x}, {1}, {0}, {0}, {0}, {0}, {0}} == 0) R' = integralClosure R (M,B,pf) = pushFwd map(R',R) From bb63d1f7ba4609334d1c897875b2fddd9b702a6c Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 8 Jul 2024 11:16:16 -0500 Subject: [PATCH 044/226] changed [basis, Variable] to accept a sequence --- M2/Macaulay2/m2/basis.m2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/m2/basis.m2 b/M2/Macaulay2/m2/basis.m2 index ff4c6c5dd50..9bb7a28a23a 100644 --- a/M2/Macaulay2/m2/basis.m2 +++ b/M2/Macaulay2/m2/basis.m2 @@ -28,10 +28,10 @@ inf := t -> if t === infinity then -1 else t ----------------------------------------------------------------------------- -- the output of this is used in BasisContext -getVarlist = (R, varlist) -> ( +getVarlist = (R, varlist) -> toList( numvars := R.numallvars ?? numgens R; if varlist === null then toList(0 .. numvars - 1) - else if instance(varlist, List) then apply(varlist, v -> + else if instance(varlist, VisibleList) then apply(varlist, v -> -- TODO: what if R = ZZ? if instance(v, R) then index v else if instance(v, ZZ) then v From 7b588c8b65ff293a6e69b93b4e9e97de033de19b Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 14 Oct 2024 11:35:30 -0400 Subject: [PATCH 045/226] Add several new words for codespell to ignore Mostly variable names --- .codespell_ignore | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.codespell_ignore b/.codespell_ignore index 5a4a9d688be..e9bbc037a60 100644 --- a/.codespell_ignore +++ b/.codespell_ignore @@ -1,3 +1,4 @@ +afile alledges allready ans @@ -8,11 +9,13 @@ ba bloks braket bu +commun comon conet coo -dorder +damon debugg +dorder egal enew euclidian @@ -22,10 +25,13 @@ falt firsth fo formes +fpt +frational freee froms geometrie hart +htpt includee inh inot @@ -36,13 +42,17 @@ ket lod lond lsat +manuel methd +mis mor multidimension nam nd nin +nome numer +oint openin ore ot @@ -50,13 +60,17 @@ packge pres pring projet +returne ser +singl skelton sring sring strat +strin sur te +thets toom tring ue From 3ac6122effc454d7bcbafd42c7a3b836a8df57df Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 14 Oct 2024 11:37:11 -0400 Subject: [PATCH 046/226] Fix a number of typos in packages Now caught after upgrading codespell to version in Ubuntu 24.04 repositories. --- .../Bertini/TST/importMainDataFile.tst.m2 | 2 +- M2/Macaulay2/packages/Complexes/Tor.m2 | 2 +- .../Documentation_GKMVarieties.m2 | 2 +- .../packages/GeometricDecomposability.m2 | 2 +- .../MonodromySolver/paper-examples/cyclic.m2 | 2 +- .../MonodromySolver/paper-examples/katsura.m2 | 2 +- .../paper-examples/large-examples/noon10.m2 | 2 +- .../MonodromySolver/solveViaMonodromy.m2 | 2 +- .../deprecated-examples/dynamicFlowerTest.m2 | 4 +- .../sparse-system-via-polynomials.m2 | 4 +- .../SYSTEMS/monodromy/sparse-system.m2 | 2 +- .../NumericalAlgebraicGeometry/doc.m2 | 2 +- M2/Macaulay2/packages/OldPolyhedra.m2 | 2 +- M2/Macaulay2/packages/Polyhedra.m2 | 2 +- M2/Macaulay2/packages/RandomCurves.m2 | 2 +- M2/Macaulay2/packages/SpechtModule.m2 | 2 +- M2/Macaulay2/packages/TSpreadIdeals.m2 | 50 +++++++++---------- M2/Macaulay2/packages/ThinSincereQuivers.m2 | 2 +- .../TropicalToric/TropicalToricDoc.m2 | 2 +- .../supplanted-packages/EdgeIdeals.m2 | 4 +- .../packages/supplanted-packages/Polyhedra.m2 | 2 +- 21 files changed, 48 insertions(+), 48 deletions(-) diff --git a/M2/Macaulay2/packages/Bertini/TST/importMainDataFile.tst.m2 b/M2/Macaulay2/packages/Bertini/TST/importMainDataFile.tst.m2 index a04bd842dca..9fb1db40ce4 100644 --- a/M2/Macaulay2/packages/Bertini/TST/importMainDataFile.tst.m2 +++ b/M2/Macaulay2/packages/Bertini/TST/importMainDataFile.tst.m2 @@ -35,7 +35,7 @@ witnessPoints=importMainDataFile(storeBM2Files) assert(#witnessPoints==2) ------ ----Bertini has a positive dimensional solve option. When this option is envoked Bertini will not produce files that have coordinates of witness points, or in otherwords we cannot use the importSolutionsFile command to get information from a positive dimensional run. +---Bertini has a positive dimensional solve option. When this option is invoked Bertini will not produce files that have coordinates of witness points, or in otherwords we cannot use the importSolutionsFile command to get information from a positive dimensional run. --For positive dimensional runs we must use the importMainDataFile command. --Positive dimensional runs automatically use regeneration. Unlike the Zero-dimensional regeneration solver singular solutions are classified in the pos dim case. diff --git a/M2/Macaulay2/packages/Complexes/Tor.m2 b/M2/Macaulay2/packages/Complexes/Tor.m2 index 382f5b957c8..38f43881987 100644 --- a/M2/Macaulay2/packages/Complexes/Tor.m2 +++ b/M2/Macaulay2/packages/Complexes/Tor.m2 @@ -185,7 +185,7 @@ TEST /// restart needsPackage "Complexes" *- - -- for quotient rings, some methods reuqire LengthLimit. + -- for quotient rings, some methods require LengthLimit. S = ZZ/101[a..e]/(e^2); I = ideal(c^3-b*d^2, b*c-a*d) J = ideal(a*c^2-b^2*d, b^3-a^2*c) diff --git a/M2/Macaulay2/packages/GKMVarieties/Documentation_GKMVarieties.m2 b/M2/Macaulay2/packages/GKMVarieties/Documentation_GKMVarieties.m2 index e476b13d12b..05001cdc571 100644 --- a/M2/Macaulay2/packages/GKMVarieties/Documentation_GKMVarieties.m2 +++ b/M2/Macaulay2/packages/GKMVarieties/Documentation_GKMVarieties.m2 @@ -208,7 +208,7 @@ doc /// Text Similarly as in type $B$, Spin groups are not implemented, so the two connected components of - $SOGr(4,8)$ need be separatedly created in the following way. + $SOGr(4,8)$ need be separately created in the following way. Example SOGr48odd = generalizedFlagVariety("D",4,{3,3}) diff --git a/M2/Macaulay2/packages/GeometricDecomposability.m2 b/M2/Macaulay2/packages/GeometricDecomposability.m2 index b7683e3a9c9..6cb349de675 100644 --- a/M2/Macaulay2/packages/GeometricDecomposability.m2 +++ b/M2/Macaulay2/packages/GeometricDecomposability.m2 @@ -191,7 +191,7 @@ initialYForms(Ideal, RingElement) := opts -> (I, y) -> ( return sub(ideal listOfInitYForms, givenRing); ); - -- if we don't have a universal Gröbner bais + -- if we don't have a universal Gröbner basis inyFormIdeal := ideal leadTerm(1,I); return sub(inyFormIdeal, givenRing); ) diff --git a/M2/Macaulay2/packages/MonodromySolver/paper-examples/cyclic.m2 b/M2/Macaulay2/packages/MonodromySolver/paper-examples/cyclic.m2 index 4faeced24d3..e44030d6915 100644 --- a/M2/Macaulay2/packages/MonodromySolver/paper-examples/cyclic.m2 +++ b/M2/Macaulay2/packages/MonodromySolver/paper-examples/cyclic.m2 @@ -14,7 +14,7 @@ parametrizedCyclic = n -> ( apply(exponents polys#i, t->(i,t)) ); AR := CC[apply(ind,i->A_i)][gens R]; - polysP := for i to #polys-1 list -- system with parameteric coefficients and same support + polysP := for i to #polys-1 list -- system with parametric coefficients and same support sum(exponents polys#i, t->A_(i,t)*AR_(t)); polySystem transpose matrix {polysP} ); diff --git a/M2/Macaulay2/packages/MonodromySolver/paper-examples/katsura.m2 b/M2/Macaulay2/packages/MonodromySolver/paper-examples/katsura.m2 index d1be838f328..28aecf973c1 100644 --- a/M2/Macaulay2/packages/MonodromySolver/paper-examples/katsura.m2 +++ b/M2/Macaulay2/packages/MonodromySolver/paper-examples/katsura.m2 @@ -25,7 +25,7 @@ parametrizedKatsura = n -> ( apply(exponents polys#i, t->(i,t)) ); AR := CC[apply(ind,i->A_i)][gens R]; - polysP := for i to #polys-1 list -- system with parameteric coefficients and same support + polysP := for i to #polys-1 list -- system with parametric coefficients and same support sum(exponents polys#i, t->A_(i,t)*AR_(t)); polySystem transpose matrix {polysP} ); diff --git a/M2/Macaulay2/packages/MonodromySolver/paper-examples/large-examples/noon10.m2 b/M2/Macaulay2/packages/MonodromySolver/paper-examples/large-examples/noon10.m2 index 019a573f755..db6fce3d9fc 100644 --- a/M2/Macaulay2/packages/MonodromySolver/paper-examples/large-examples/noon10.m2 +++ b/M2/Macaulay2/packages/MonodromySolver/paper-examples/large-examples/noon10.m2 @@ -18,7 +18,7 @@ x_10*x_1^2+x_10*x_2^2+x_10*x_3^2+x_10*x_4^2+x_10*x_5^2+x_10*x_6^2+x_10*x_7^2+x_1 apply(exponents polys#i, t->(i,t)) ); AR := CC[apply(ind,i->A_i)][gens R]; - polysP := for i to #polys-1 list -- system with parameteric coefficients and same support + polysP := for i to #polys-1 list -- system with parametric coefficients and same support sum(exponents polys#i, t->A_(i,t)*AR_(t)); polySystem transpose matrix {polysP} ) diff --git a/M2/Macaulay2/packages/MonodromySolver/solveViaMonodromy.m2 b/M2/Macaulay2/packages/MonodromySolver/solveViaMonodromy.m2 index fb9110bd136..3a02832b41b 100644 --- a/M2/Macaulay2/packages/MonodromySolver/solveViaMonodromy.m2 +++ b/M2/Macaulay2/packages/MonodromySolver/solveViaMonodromy.m2 @@ -223,7 +223,7 @@ sparseMonodromySolve PolySystem := o -> PS -> ( if numgens coefficientRing R > 0 then error "expected parameter-less system"; W := symbol W; AR := CC[apply(ind,i->W_i)][gens R]; - polysP := transpose matrix{for i to #polys-1 list -- system with parameteric coefficients and same support + polysP := transpose matrix{for i to #polys-1 list -- system with parametric coefficients and same support sum(exponents polys#i, t->W_(i,t)*AR_(t))}; P := if o#"new tracking routine" then gateSystem polysP else polySystem polysP; targetParam := point sub(fold(polys/coefficients/last,(a,b)->a||b),CC); diff --git a/M2/Macaulay2/packages/MonodromySolver/under-construction-examples/deprecated-examples/dynamicFlowerTest.m2 b/M2/Macaulay2/packages/MonodromySolver/under-construction-examples/deprecated-examples/dynamicFlowerTest.m2 index 93aefa68716..981c6ee4601 100644 --- a/M2/Macaulay2/packages/MonodromySolver/under-construction-examples/deprecated-examples/dynamicFlowerTest.m2 +++ b/M2/Macaulay2/packages/MonodromySolver/under-construction-examples/deprecated-examples/dynamicFlowerTest.m2 @@ -7,11 +7,11 @@ n= 7; S = gens cyclicRoots(n,CC) R = ring S polys = flatten entries S -ind = flatten apply(#polys,i-> -- parameteric coefficients +ind = flatten apply(#polys,i-> -- parametric coefficients apply(exponents polys#i, t->(i,t)) ) AR = CC[apply(ind,i->A_i)][gens R] -polysP = for i to #polys-1 list -- parameteric coefficients +polysP = for i to #polys-1 list -- parametric coefficients sum(exponents polys#i, t->A_(i,t)*AR_(t)) SP = matrix{polysP} c0 = point{ diff --git a/M2/Macaulay2/packages/NumericalAlgebraicGeometry/SYSTEMS/monodromy/sparse-system-via-polynomials.m2 b/M2/Macaulay2/packages/NumericalAlgebraicGeometry/SYSTEMS/monodromy/sparse-system-via-polynomials.m2 index e144e2d97f2..ea5d0998a1f 100644 --- a/M2/Macaulay2/packages/NumericalAlgebraicGeometry/SYSTEMS/monodromy/sparse-system-via-polynomials.m2 +++ b/M2/Macaulay2/packages/NumericalAlgebraicGeometry/SYSTEMS/monodromy/sparse-system-via-polynomials.m2 @@ -9,11 +9,11 @@ n = 6 S = gens cyclicRoots(n,CC) R = ring S polys = flatten entries S -ind = flatten apply(#polys,i-> -- parameteric coefficients +ind = flatten apply(#polys,i-> -- parametric coefficients apply(exponents polys#i, t->(i,t)) ) AR = CC[apply(ind,i->A_i)][gens R] -polysP = for i to #polys-1 list -- parameteric coefficients +polysP = for i to #polys-1 list -- parametric coefficients sum(exponents polys#i, t->A_(i,t)*AR_(t)) SP = matrix{polysP} diff --git a/M2/Macaulay2/packages/NumericalAlgebraicGeometry/SYSTEMS/monodromy/sparse-system.m2 b/M2/Macaulay2/packages/NumericalAlgebraicGeometry/SYSTEMS/monodromy/sparse-system.m2 index 6a161d84abf..59656711426 100644 --- a/M2/Macaulay2/packages/NumericalAlgebraicGeometry/SYSTEMS/monodromy/sparse-system.m2 +++ b/M2/Macaulay2/packages/NumericalAlgebraicGeometry/SYSTEMS/monodromy/sparse-system.m2 @@ -12,7 +12,7 @@ monoms = flatten entries monomials F toGate = m -> product apply(X,first first listForm m,(x,a)->x^a) M = hashTable apply(monoms, m->m=>toGate m) -- monomials polys = flatten entries F -C = apply(#polys,i-> -- parameteric coefficients +C = apply(#polys,i-> -- parametric coefficients apply(flatten entries monomials polys#i, m->inputGate (symbol c)_(i,m)) ) S = transpose matrix{ diff --git a/M2/Macaulay2/packages/NumericalAlgebraicGeometry/doc.m2 b/M2/Macaulay2/packages/NumericalAlgebraicGeometry/doc.m2 index 848909aa3be..cea8b7d9914 100644 --- a/M2/Macaulay2/packages/NumericalAlgebraicGeometry/doc.m2 +++ b/M2/Macaulay2/packages/NumericalAlgebraicGeometry/doc.m2 @@ -878,7 +878,7 @@ document { "valuesP" => {" contains (possibly several sets of) values of the parameters"} }, Outputs => { "sols"=>" lists of lists of solutions for each set of the parameters" }, - "Solves a parameteric polynomial system for several values of parameters.", + "Solves a parametric polynomial system for several values of parameters.", EXAMPLE lines /// R = CC[u1,u2,u3,x,y] f1 = u1*(y-1)+u2*(y-2)+u3*(y-3) diff --git a/M2/Macaulay2/packages/OldPolyhedra.m2 b/M2/Macaulay2/packages/OldPolyhedra.m2 index 05c6c98e46f..3e8d1478bff 100644 --- a/M2/Macaulay2/packages/OldPolyhedra.m2 +++ b/M2/Macaulay2/packages/OldPolyhedra.m2 @@ -5,7 +5,7 @@ -- -- PURPOSE: Computations with convex polyhedra -- PROGRAMMER : René Birkner --- UPDATE HISTORY : April 2008, December 2008, March 2009, Juli 2009, +-- UPDATE HISTORY : April 2008, December 2008, March 2009, July 2009, -- September 2009, October 2009, January 2010 --------------------------------------------------------------------------- newPackage("OldPolyhedra", diff --git a/M2/Macaulay2/packages/Polyhedra.m2 b/M2/Macaulay2/packages/Polyhedra.m2 index fb193f5bb8c..b92263afec7 100644 --- a/M2/Macaulay2/packages/Polyhedra.m2 +++ b/M2/Macaulay2/packages/Polyhedra.m2 @@ -3,7 +3,7 @@ -- -- PURPOSE: Computations with convex polyhedra -- PROGRAMMER : René Birkner --- UPDATE HISTORY : April 2008, December 2008, March 2009, Juli 2009, +-- UPDATE HISTORY : April 2008, December 2008, March 2009, July 2009, -- September 2009, October 2009, January 2010 --------------------------------------------------------------------------- newPackage("Polyhedra", diff --git a/M2/Macaulay2/packages/RandomCurves.m2 b/M2/Macaulay2/packages/RandomCurves.m2 index ad174ddb3e4..d92c4823ec9 100644 --- a/M2/Macaulay2/packages/RandomCurves.m2 +++ b/M2/Macaulay2/packages/RandomCurves.m2 @@ -1,7 +1,7 @@ newPackage( "RandomCurves", Version => "0.6", - Date => "Juli 5, 2011", + Date => "July 5, 2011", Authors => {{Name => "Frank-Olaf Schreyer", Email => "schreyer@math.uni-sb.de", HomePage => "http://www.math.uni-sb.de/ag/schreyer/"}, diff --git a/M2/Macaulay2/packages/SpechtModule.m2 b/M2/Macaulay2/packages/SpechtModule.m2 index 4a8f2439189..4004c8bed4f 100644 --- a/M2/Macaulay2/packages/SpechtModule.m2 +++ b/M2/Macaulay2/packages/SpechtModule.m2 @@ -2244,7 +2244,7 @@ multidoc /// y:YoungTableau Outputs :List - a dubly nested list with the permutations in the row stabilizer + a doubly nested list with the permutations in the row stabilizer Description Text The row stabilizer of a tableau is the group of the permutations that fixes the rows of diff --git a/M2/Macaulay2/packages/TSpreadIdeals.m2 b/M2/Macaulay2/packages/TSpreadIdeals.m2 index 5cab56126bc..2f59833ec67 100644 --- a/M2/Macaulay2/packages/TSpreadIdeals.m2 +++ b/M2/Macaulay2/packages/TSpreadIdeals.m2 @@ -727,7 +727,7 @@ Key => {tNextMon,(tNextMon,RingElement,ZZ)}, Headline => "give the t-lex successor of a given t-spread monomial", Usage => "tNextMon(u,t)", Inputs => {"u" => {"a t-spread monomial of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {RingElement => {"the greatest ", TT "t", "-spread monomial less than ", TT "u", ", with respect to lexcografic order"}}, "the function ", TT "tNextMon(u,t)", " gives the ", TT "t" , "-lex successor of ", TT "t", ", that is, the greatest ", TT "t" , "-spread monomial less than ", , TT "u", " with respect to ", TEX///$>_\mathrm{slex}.$///,BR{}, @@ -748,7 +748,7 @@ Headline => "give the last t-spread monomial of the Borel shadow a given t-sprea Usage => "tLastMon(u,gap,t)", Inputs => {"u" => {"a t-spread monomial of a polynomial ring"}, "gap" => {"a positive integer representing the difference between the degrees"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {RingElement => {"the smallest ", TT "t", "-spread monomial of the Borel shadow of ", TT "u", ", with respect to lexcografic order"}}, "the function ", TT "tLastMon(u,gap,t)", " gives the smallest ", TT "t" , "-spread monomials of the Borel shadow iterated ", TT "gap", "times of ", TT "u", ", that is, the smallest monomial of ", TEX///$B_\texttt{t}\{\texttt{u}\}$///, ", with respect to ", TEX///$>_\mathrm{slex}.$///,BR{}, @@ -769,7 +769,7 @@ Headline => "give the t-lex segment with given extremes", Usage => "tLexSeg(v,u,t)", Inputs => {"v" => {"a t-spread monomial of a polynomial ring"}, "u" => {"a t-spread monomial of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"the set of all the ", TT "t", "-spread monomials smaller than ", TT "v", " and greater than ", TT "u", ", with respect to lexcografic order"}}, "the function ", TT "tLexSeg(v,u,t)", " gives the ", TT "t" , "-lex segment defined by ", TT "v", " and ", TT "u", ", that is, the set of all the ", TT "t" , "-spread monomials smaller than ", , TT "v", " and greater than ", TT "u", ", with respect to ", TEX///$>_\mathrm{slex}.$///,BR{}, @@ -805,7 +805,7 @@ Key => {tLexMon,(tLexMon,RingElement,ZZ)}, Headline => "give the smallest initial t-lex segment containing a given monomial", Usage => "tLexMon(u,t)", Inputs => {"u" => {"a t-spread monomial of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"the set of all the ", TT "t", "-spread monomials greater than ", TT "u", ", with respect to lexcografic order"}}, "the function ", TT "tLexMon(u,t)", " gives the initial ", TT "t" , "-lex segment defined by ", TT "u", ", that is, the set of all the ", TT "t" , "-spread monomials greater than ", TT "u", ", with respect to ", TEX///$>_\mathrm{slex}.$///,BR{}, @@ -824,7 +824,7 @@ Key => {countTLexMon,(countTLexMon,RingElement,ZZ)}, Headline => "give the cardinality of the smallest initial t-lex segment containing a given monomial", Usage => "countTLexMon(u,t)", Inputs => {"u" => {"a t-spread monomial of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {ZZ => {"the number of all the ", TT "t", "-spread monomials greater than ", TT "u", ", with respect to lexcografic order"}}, "the function ", TT "countTLexMon(u,t)", " gives the cardinality of ", TEX///$L_t\{u\}$///, ", the initial ", TT "t" , "-lex segment defined by ", TT "u", ", that is, the number of all the ", TT "t" , "-spread monomials greater than ", TT "u", ", with respect to ", TEX///$>_\mathrm{slex}.$///,BR{}, @@ -846,7 +846,7 @@ Headline => "give the Veronese set of t-spread monomials of a given degree", Usage => "tVeroneseSet(S,d,t)", Inputs => {"S" => {"a polynomial ring"}, "d" => {"a nonnegative integer that identifies the degree of the monomials"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"the set of all the ", TT "t", "-spread monomials of ", TT "S", " of degree ", TT "d"}}, "the function ", TT "tVeroneseSet(S,d,t)", " gives the Veronese set of ", TT "t" , "-spread monomials of degree ", TT "d", ", that is, the set of all the ", TT "t" , "-spread monomials of ", TT "S", " of degree ", TT "d", @@ -866,7 +866,7 @@ Headline => "give the Veronese ideal of t-spread monomials of a given degree", Usage => "tVeroneseIdeal(S,d,t)", Inputs => {"S" => {"a polynomial ring"}, "d" => {"a nonnegative integer that identifies the degree of the monomials"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {Ideal => {"the ideal generated by all the ", TT "t", "-spread monomials of ", TT "S", " of degree ", TT "d"}}, "the function ", TT "tVeroneseIdeal(S,d,t)", " returns the Veronese ideal of ", TT "t" , "-spread monomials of degree ", TT "d", ", that is, the ideal generated by all the ", TT "t" , "-spread monomials of ", TT "S", " of degree ", TT "d", @@ -885,7 +885,7 @@ Key => {tPascalIdeal,(tPascalIdeal,Ring,ZZ)}, Headline => "give the Pascal ideal of t-spread monomials of a given polynomial ring", Usage => "tPascalIdeal(S,t)", Inputs => {"S" => {"a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {Ideal => {"the Pascal ideal of ", TT "t", "-spread monomials of ", TT "S"}}, "the function ", TT "tPascalIdeal(S,t)", " returns the Pascal ideal of ", TT "t" , "-spread monomials of ", TT "S", ", that is, the ideal generated by the minimum number of ", TT "t" , "-spread monomials of ", TT "S", " with the greatest possible degrees and such that the supports of the generators are pairwise disjoint.", @@ -902,7 +902,7 @@ Key => {tSpreadList,(tSpreadList,List,ZZ)}, Headline => "give the set of all t-spread monomials of a given list", Usage => "tSpreadList(l,t)", Inputs => {"l" => {"a list of t-spread monomials of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"the set of all the ", TT "t", "-spread monomials belonging to ", TT "l"}}, "the function ", TT "tSpreadList(l,t)", " gives the list of all the ", TT "t" , "-spread monomials ", TT "l", ".",BR{}, @@ -923,7 +923,7 @@ Key => {tSpreadIdeal,(tSpreadIdeal,Ideal,ZZ)}, Headline => "give the ideal generated by the t-spread monomials which are among the generators of a given ideal", Usage => "tSpreadIdeal(I,t)", Inputs => {"I" => {"a graded ideal of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {Ideal => {"the ideal generated by all the ", TT "t", "-spread monomials belonging to the generator set of the ideal ", TT "I"}}, "the function ", TT "tSpreadIdeal(I,t)", " gives the ideal generated by all the ", TT "t" , "-spread monomials which are among the generators of the ideal ", TT "I", ".",BR{}, @@ -946,7 +946,7 @@ Usage => "isTSpread(u,t), isTSpread(l,t) or isTSpread(I,t)", Inputs => {"u" => {"a monomial of a polynomial ring"}, "l" => {"a list of monomials of a polynomial ring"}, "I" => {"a monomial ideal of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {Boolean => {"whether a given monomial ", TT "u", ", a list of monomials " , TT "l", " or a monomial ideal ", TT "I", " is ", TT "t", "-spread"}}, "the function ", TT "isTSpread(-,t)", " has three overloading changing for the first parameter. It checks whether a given monomial ", TT "u", ", a list of monomials ", TT "l", " or a monomial ideal ", TT "I", " is ", TT "t" , "-spread.",BR{}, @@ -969,7 +969,7 @@ Headline => "give the t-spread shadow of a given t-spread monomial or a given li Usage => "tShadow(u,t)", Inputs => {"u" => {"a t-spread monomial of a polynomial ring"}, "l" => {"a list of t-spread monomials of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"the list of all the ", TT "t", "-spread monomial of the shadow of the ", TT "t", "-spread monomial ", TT "u", " or of the list ", TT "l"}}, "the function ", TT "tShadow(u,t)", " gives the ", TT "t" , "-spread shadow of ", TT "u", ", that is, the set of all the ", TT "t" , "-spread monomials of the shadow of ", TT "u", ". The overloading function ", TT "tShadow(l,t)", " gives the ", TT "t" , "-spread shadow of ", TT "l", ", that is, the set of all the ", TT "t" , "-spread monomials of the shadow of each ", TT "t", "-spread monomial belonging to ", TT "l", ".",BR{}, @@ -994,7 +994,7 @@ Usage => "tMacaulayExpansion(a,n,d,t)", Inputs => {"a" => {"a positive integer to be expanded"}, "n" => {"a positive integer that identifies the number of indeterminates"}, "d" => {"a positive integer that identifies the degree"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"pairs of positive integers representing the ", TT "d", "-th (shifted) t-Macaulay expansion of ", TT "a", " with a given ", TT "n"}}, "Given four positive integers ", TT "(a,n,d,t)", " there is a unique expression of ", TT "a", " as a sum of binomials ", TEX///$a=\binom{a_d}{d} + \binom{a_{d-1}}{d-1} + \cdots + \binom{a_j}{j}.$///, " where ", TEX///$a_i > a_{i-1} > \cdots > a_j > j >= 1.$///,BR{}, @@ -1014,7 +1014,7 @@ Key => {fTVector,(fTVector,Ideal,ZZ)}, Headline => "compute the ft-vector of a given t-spread ideal of a polynomial ring", Usage => "fTVector(I,t)", Inputs => {"I" => {"a t-spread ideal of polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"a list of nonnegative integers representing the ft-vector of the t-spread ideal ", TT "I"}}, "Let ", TT "I", " be a ", TT "t", "-spread ideal of the polynomial ring ", TEX///$S=K[x_1,\ldots,x_n]$///, " One can define the ", TEX///$f_\texttt{t}$///, "-vector of ", TT "I", " as ", TEX///$f_\texttt{t}(\texttt{I})=\left( f_{\texttt{t},-1}(\texttt{I}), f_{\texttt{t},0}(\texttt{I}), \ldots, f_{\texttt{t},j}(\texttt{I}), \ldots \right),$///, BR{}, @@ -1035,7 +1035,7 @@ Headline => "whether a given list of nonnegative integers is the ft-vector of a Usage => "isFTVector(S,f,t)", Inputs => {"S" => {"a polynomial ring"}, "f" => {"a list of nonnegative integers"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {Boolean => {"whether the list ", TT "f", " represents the ft-vector of a t-strongly stable ideal of ", TT "S"}}, "Let ", TEX///$\texttt{S}=K[x_1,\ldots,x_n]$///, ", ", TEX///$\texttt{t}\geq 1$///, " and let ", TEX///$\texttt{f}=(f(0),f(1),\ldots,f(d),\ldots)$///, " be a sequence of nonnegative integers. The sequence ", TT "f", " is the ", TEX///$\texttt{f}_\texttt{t}$///, "-vector of a ", TT "t", "-spread ideal of ", TT "S", " if the following conditions hold:",BR{}, @@ -1060,7 +1060,7 @@ Usage => "tLexIdeal(S,f,t) or tLexIdeal(I,t)", Inputs => {"S" => {"a polynomial ring"}, "f" => {"a sequence of nonnegative integers"}, "I" => {"a t-strongly stable ideal of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {Ideal => {"the t-spread lex ideal with ft-vector ", TT "f", " or the t-spread lex ideal with the same ft-vector of ", TT "I"}}, "It has been proved that if ", TT "I", " is a ", TT "t", "-strongly stable ideal then a unique ", TT "t", "-lex ideal with the same ", TEX///$f_\texttt{t}$///, "-vector of ", TT "I", " exists.", BR{}, @@ -1084,7 +1084,7 @@ Key => {isTLexIdeal,(isTLexIdeal,Ideal,ZZ)}, Headline => "whether a given t-spread ideal is t-spread lex", Usage => "isTLexIdeal(I,t)", Inputs => {"I" => {"a t-spread ideal of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {Boolean => {"whether the ideal ", TT "I", " is t-spread lex"}}, "Let ", TEX///$\texttt{S}=K[x_1,\ldots,x_n]$///, ", ", TEX///$\texttt{t}\geq 1$///, " and a ", TT "t", "-spread ideal ", TT "I", ". Then ", TT "I", " is called a ", TT "t", "-lex ideal, if ", TEX///$[I_j]_t$///, " is a ", TT "t", "-spread lex set for all ", TEX///$j$///, ".",BR{}, @@ -1104,7 +1104,7 @@ Headline => "give the t-strongly stable segment with the given extremes", Usage => "tStronglyStableSeg(v,u,t)", Inputs => {"v" => {"a t-spread monomial of a polynomial ring"}, "u" => {"a t-spread monomial of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"the set of all the ", TT "t", "-spread monomials of the t-stromgly stable set generated by ", TT "u", " and smaller than ", TT "u", ", with respect to lexcografic order"}}, "the function ", TT "tStronglyStableSeg(v,u,t)", " gives the set of ", TT "t" , "-spread monomials belonging to the strongly stable set generated by ", TT "u", " and smaller than ", TT "v", ", that is, ", TEX///$B_t[v,u]=\{w\in B_t\{u\}\ :\ v\geq_\mathrm{slex} w\}.$///,BR{}, @@ -1124,7 +1124,7 @@ Key => {isTStronglyStableSeg,(isTStronglyStableSeg,List,ZZ)}, Headline => "whether the given list of t-spread monomials is a t-strongly stable segment", Usage => "isTStronglyStableSeg(l,t)", Inputs => {"l" => {"a list of t-spread monomials of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {Boolean => {"whether the list ", TT "l", " of ", TT "t", "-spread monomials is a ", TT "t", "-strongly stable segment"}}, "the function ", TT "isTStronglyStableSeg(l,t)", " is ", TT "true", " whether the list of monomials ", TT "l" , " is a ", TT "t", "-strongly stable segment, that is, the set of all the ", TT "t" , "-spread monomials belonging to the strongly stable set generated by the smallest monomial of ", TT "l", " and smaller than the greatest monomial of ", TT "l", ", with respect to ", TEX///$>_\mathrm{slex}.$///,BR{}, @@ -1145,7 +1145,7 @@ Key => {tStronglyStableMon,(tStronglyStableMon,RingElement,ZZ)}, Headline => "give the t-strongly stable set generated by a given monomial", Usage => "tStronglyStableMon(u,t)", Inputs => {"u" => {"a t-spread monomial of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"the list of all the ", TT "t", "-spread monomials of the ", TT "t", "-strongly stable set generated by ", TT "u"}}, "the function ", TT "tStronglyStableMon(u,t)", " gives the list of all the monomials belonging to the ", TT "t" , "-strongly stable set generated by ", TT "u", ", that is, ", TEX///$B_t\{u\}.$///,BR{}, @@ -1165,7 +1165,7 @@ Key => {countTStronglyStableMon,(countTStronglyStableMon,RingElement,ZZ)}, Headline => "give the cardinality of the t-strongly stable set generated by a given monomial", Usage => "countTStronglyStableMon(u,t)", Inputs => {"u" => {"a t-spread monomial of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {ZZ => {"the number of all the ", TT "t", "-spread monomials of the ", TT "t", "-strongly stable set generated by ", TT "u"}}, "the function ", TT "countTStronglyStableMon(u,t)", " gives the cardinality of ", TEX///$B_t\{u\}$///, ", the ", TT "t" , "-strongly stable set generated by ", TT "u", ", that is, the number of all the ", TT "t" , "-spread monomials belonging to the smallest ", TT "t", "-strongly stable set containing ", TT "u",BR{}, @@ -1185,7 +1185,7 @@ Key => {tStronglyStableIdeal,(tStronglyStableIdeal,Ideal,ZZ)}, Headline => "give the smallest t-strongly stable ideal containing a given t-spread ideal", Usage => "tStronglyStableIdeal(I,t)", Inputs => {"I" => {"a t-spread ideal of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"the smallest ", TT "t", "-strongly stable ideal containing the ", TT "t", "-spread ideal ", TT "I"}}, "the function ", TT "tStronglyStableIdeal(I,t)", " gives the smallest ", TT "t" , "-strongly stable ideal containing ", TT "I", ", that is, ", TEX///$B_t(G(I))$///, " where ", TEX///$G(I)$///, " is the minimal set of generators of ", TEX///$I$///, BR{}, @@ -1206,7 +1206,7 @@ Key => {isTStronglyStableIdeal,(isTStronglyStableIdeal,Ideal,ZZ)}, Headline => "whether a given t-spread ideal is t-strongly stable", Usage => "isTStronglyStableIdeal(I,t)", Inputs => {"I" => {"a t-spread ideal of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {Boolean => {"whether the ideal ", TT "I", " is t-spread lex"}}, "Let ", TEX///$\texttt{S}=K[x_1,\ldots,x_n]$///, ", ", TEX///$\texttt{t}\geq 1$///, " and a ", TT "t", "-spread ideal ", TT "I", ". Then ", TT "I", " is called a ", TT "t", "-strongly stable ideal, if ", TEX///$[I_j]_t$///, " is a ", TT "t", "-strongly stable set for all ", TEX///$j$///, ".",BR{}, @@ -1225,7 +1225,7 @@ Key => {tExtremalBettiCorners,(tExtremalBettiCorners,Ideal,ZZ)}, Headline => "give the corners of the extremal Betti numbers of a given t-strongly stable ideal", Usage => "tExtremalBettiCorners(I,t)", Inputs => {"I" => {"a t-strongly stable graded ideal of a polynomial ring"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"the corners of the extremal Betti numbers of the ideal ", TT "I"}}, "let ", TEX///$S=K[x_1,\ldots,x_n]$///, " be a polynomial ring over a field ", TEX///$K$///," and let ", TT "I", " a graded ideal of ", TEX///$S$///,". A graded Betti number of the ideal ", TEX///$\beta_{k,k+\ell}(I)\ne 0$///, " is called extremal if ", TEX///$\beta_{i,i+j}(I)=0$///, " for all ", TEX///$i\ge k,j\ge\ell,(i,j)\ne(k,\ell).$///,BR{}, @@ -1248,7 +1248,7 @@ Usage => "tExtremalBettiMonomials(S,corners,a,t)", Inputs => {"S" => {"a polynomial ring"}, "corners" => {"a list of pairs of positive integers"}, "a" => {"a list of positive integers"}, - "t" => {"a positive integer that idenfies the t-spread contest"} + "t" => {"a positive integer that identifies the t-spread contest"} }, Outputs => {List => {"the t-spread basic monomials to obtain the extremal Betti numbers positioned in ", TT "cornes", " and with values ", TT "a"}}, "let ", TEX///$S=K[x_1,\ldots,x_n]$///, " be a polynomial ring over a field ", TEX///$K$///," and let ", TT "I", " a graded ideal of ", TEX///$S$///,". A graded Betti number of the ideal ", TEX///$\beta_{k,k+\ell}(I)\ne 0$///, " is called extremal if ", TEX///$\beta_{i,i+j}(I)=0$///, " for all ", TEX///$i\ge k,j\ge\ell,(i,j)\ne(k,\ell).$///,BR{}, diff --git a/M2/Macaulay2/packages/ThinSincereQuivers.m2 b/M2/Macaulay2/packages/ThinSincereQuivers.m2 index 2a8939dac93..68c2dd3679d 100644 --- a/M2/Macaulay2/packages/ThinSincereQuivers.m2 +++ b/M2/Macaulay2/packages/ThinSincereQuivers.m2 @@ -2833,7 +2833,7 @@ multidoc /// Description Text This method uses the {\tt interiorVector} method for a Cone from the {\tt Polyhedra} - package to generate a single internal poin for each of the cones in the input list {\tt QCS}. + package to generate a single internal point for each of the cones in the input list {\tt QCS}. Example Q = toricQuiver {{0,1},{0,2},{0,3},{1,2},{1,3},{2,3}}; CS = coneSystem Q; diff --git a/M2/Macaulay2/packages/TropicalToric/TropicalToricDoc.m2 b/M2/Macaulay2/packages/TropicalToric/TropicalToricDoc.m2 index 8a2603cb901..cce9234e185 100644 --- a/M2/Macaulay2/packages/TropicalToric/TropicalToricDoc.m2 +++ b/M2/Macaulay2/packages/TropicalToric/TropicalToricDoc.m2 @@ -245,7 +245,7 @@ doc /// -- Headline -- headline -- Usage --- functio(input) +-- function(input) -- Inputs -- input: type of the input -- some text diff --git a/M2/Macaulay2/packages/supplanted-packages/EdgeIdeals.m2 b/M2/Macaulay2/packages/supplanted-packages/EdgeIdeals.m2 index 1dab9cdcde7..557b7ec34d8 100644 --- a/M2/Macaulay2/packages/supplanted-packages/EdgeIdeals.m2 +++ b/M2/Macaulay2/packages/supplanted-packages/EdgeIdeals.m2 @@ -1330,7 +1330,7 @@ doc /// E = {{a,b,c},{b,c,d},{c,d,e},{e,d,f}} h = hyperGraph (R,E) Text - Altenatively, if the polynomial ring has already been defined, it suffices to simply enter + Alternatively, if the polynomial ring has already been defined, it suffices to simply enter the list of the edges. Example S = QQ[z_1..z_8] @@ -1417,7 +1417,7 @@ doc /// E = {{a,b},{b,c},{c,f},{d,a},{e,c},{b,d}} g = graph (R,E) Text - Altenatively, if the polynomial ring has already been defined, it suffices to simply enter + Alternatively, if the polynomial ring has already been defined, it suffices to simply enter the list of the edges. Example S = QQ[z_1..z_8] diff --git a/M2/Macaulay2/packages/supplanted-packages/Polyhedra.m2 b/M2/Macaulay2/packages/supplanted-packages/Polyhedra.m2 index 6b18f4ed574..1a1493dfa97 100644 --- a/M2/Macaulay2/packages/supplanted-packages/Polyhedra.m2 +++ b/M2/Macaulay2/packages/supplanted-packages/Polyhedra.m2 @@ -3,7 +3,7 @@ -- -- PURPOSE: Computations with convex polyhedra -- PROGRAMMER : René Birkner --- UPDATE HISTORY : April 2008, December 2008, March 2009, Juli 2009, +-- UPDATE HISTORY : April 2008, December 2008, March 2009, July 2009, -- September 2009 --------------------------------------------------------------------------- newPackage("Polyhedra", From 1b8e611b76bbbd69df8320d5fc85e25a6f9a47e6 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 7 Oct 2024 15:31:25 -0400 Subject: [PATCH 047/226] Bump normaliz to 3.10.4 --- M2/cmake/build-libraries.cmake | 4 ++-- M2/libraries/normaliz/Makefile.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/M2/cmake/build-libraries.cmake b/M2/cmake/build-libraries.cmake index 311dde5fc20..876ef245b5b 100644 --- a/M2/cmake/build-libraries.cmake +++ b/M2/cmake/build-libraries.cmake @@ -966,8 +966,8 @@ _ADD_COMPONENT_DEPENDENCY(libraries nauty "" NAUTY_FOUND) # https://www.normaliz.uni-osnabrueck.de/ # normaliz needs libgmp, libgmpxx, boost, and openmp, and is used by the package Normaliz ExternalProject_Add(build-normaliz - URL https://github.com/Normaliz/Normaliz/releases/download/v3.10.2/normaliz-3.10.2.tar.gz - URL_HASH SHA256=0f649a8eae5535c18df15e8d35fc055fd0d7dbcbdd451e8876f4a47061481f07 + URL https://github.com/Normaliz/Normaliz/releases/download/v3.10.4/normaliz-3.10.4.tar.gz + URL_HASH SHA256=9b424f966d553ae32e710b8ab674c7887ddcbf0e5ea08af7f8bc1b587bcbb2aa PREFIX libraries/normaliz SOURCE_DIR libraries/normaliz/build DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/BUILD/tarfiles diff --git a/M2/libraries/normaliz/Makefile.in b/M2/libraries/normaliz/Makefile.in index 1b1d47c5318..edd1b2a8b66 100644 --- a/M2/libraries/normaliz/Makefile.in +++ b/M2/libraries/normaliz/Makefile.in @@ -1,6 +1,6 @@ HOMEPAGE = https://www.normaliz.uni-osnabrueck.de/ # get releases from https://github.com/Normaliz/Normaliz/releases -VERSION = 3.10.3 +VERSION = 3.10.4 #PATCHFILE = @abs_srcdir@/patch-$(VERSION) URL = https://github.com/Normaliz/Normaliz/releases/download/v$(VERSION) From 49fc56302e1219c8066ea68cf64eecb05ee8091e Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 14 Oct 2024 02:29:51 +0200 Subject: [PATCH 048/226] added Normaliz to LIBRARY_OPTIONS --- M2/cmake/check-libraries.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/cmake/check-libraries.cmake b/M2/cmake/check-libraries.cmake index b8e6a738022..850b0c10a36 100644 --- a/M2/cmake/check-libraries.cmake +++ b/M2/cmake/check-libraries.cmake @@ -154,7 +154,7 @@ pkg_search_module(GIVARO IMPORTED_TARGET givaro>=4.1.1) set(LIBRARY_OPTIONS Eigen3 BDWGC MPFR MPFI NTL Flint Factory Frobby cddlib MPSolve - GTest GLPK Givaro FFLAS_FFPACK) + GTest GLPK Givaro FFLAS_FFPACK Normaliz) ############################################################################### ## Optional libraries: From 17a97bc1d957422e23369ddc9b2da20c63ad5c0e Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 14 Oct 2024 13:53:53 -0400 Subject: [PATCH 049/226] Include config.log from check-configure in GitHub build artifacts Useful for debugging when check-configure fails --- .github/workflows/test_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_build.yml b/.github/workflows/test_build.yml index bd9b41dc0e2..66bec447d29 100644 --- a/.github/workflows/test_build.yml +++ b/.github/workflows/test_build.yml @@ -224,6 +224,7 @@ jobs: path: | # Autotools M2/BUILD/build/config.log + M2/BUILD/build/check-configure/tmp/config.log M2/BUILD/build/include/* M2/BUILD/build/libraries/*/build/*/config.log # CMake From 10cee3a5156104c343b383650c76d074766a0271 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 14 Oct 2024 20:42:40 +0200 Subject: [PATCH 050/226] fixed handling of BUILD_LIBRARIES in cmake --- M2/cmake/check-libraries.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/M2/cmake/check-libraries.cmake b/M2/cmake/check-libraries.cmake index 850b0c10a36..9707b9e2a07 100644 --- a/M2/cmake/check-libraries.cmake +++ b/M2/cmake/check-libraries.cmake @@ -232,7 +232,8 @@ foreach(_library IN LISTS LIBRARY_OPTIONS) elseif(BUILD_LIBRARIES MATCHES "(ALL|ON)" OR "${_name}" IN_LIST BUILD_LIBRARIES) # exists on the system, but we want to build it unset(${_library}_DIR CACHE) # for Eigen3 - unset(${_name}_FOUND CACHE) + unset(${_name}_FOUND CACHE) # for fflas_ffpack and givaro + unset(${_name}_FOUND) # for everything else unset(${_name}_LIBDIR CACHE) unset(${_name}_LIBRARY CACHE) unset(${_name}_LIBRARIES CACHE) From 187a52826a572c1f3ea411d29f2068af6b9113d6 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 15 Oct 2024 07:06:31 -0400 Subject: [PATCH 051/226] Add -lgmpxx to LIBS when checking for normaliz (autotools) Otherwise, we get "undefined reference" errors when linking against a static libnormaliz and fail to detect it. --- M2/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/configure.ac b/M2/configure.ac index b900ae8ca6b..573fbeea5b5 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -1043,7 +1043,7 @@ AS_IF([test $BUILD_normaliz = no], AC_MSG_CHECKING([for libnormaliz]) AC_LANG(C++) SAVELIBS=$LIBS - LIBS="$LIBS -lnormaliz -lgmp" + LIBS="$LIBS -lnormaliz -lgmp -lgmpxx" CHECK_NMZ_PACKAGE([ENFNORMALIZ], [-leantic -leanticxx]) CHECK_NMZ_PACKAGE([NMZ_COCOA], [-lcocoa]) CHECK_NMZ_PACKAGE([NMZ_NAUTY], [-lnauty]) From a136d1c82e3d3c258c66d392e8d0bbcdd18eaa6e Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 15 Oct 2024 18:06:35 -0400 Subject: [PATCH 052/226] Specify C++14 when compiling normaliz (autotools) --- M2/libraries/normaliz/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/libraries/normaliz/Makefile.in b/M2/libraries/normaliz/Makefile.in index edd1b2a8b66..f4ef3ad9ace 100644 --- a/M2/libraries/normaliz/Makefile.in +++ b/M2/libraries/normaliz/Makefile.in @@ -33,7 +33,7 @@ NORMFLAGS = CXXFLAGS1 = $(CPPFLAGS) -Wall -O3 -Wno-unknown-pragmas -I .. -I . $(CXXFLAGS0) BUILDOPTIONS = CXX="$(CXX)" \ NORMFLAGS="$(NORMFLAGS)" \ - CXXFLAGS="$(CXXFLAGS1)" \ + CXXFLAGS="$(CXXFLAGS1) -std=c++14" \ RANLIB="@RANLIB@" \ GMPFLAGS="$(LDFLAGS) -lgmpxx -lgmp" PROGRAMS = source/normaliz From fed185dfd9842737d1263c45bf2ed7f919a5e2e8 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 15 Oct 2024 20:33:17 -0400 Subject: [PATCH 053/226] Use AC_OPENMP results to get correct flags for normaliz (autotools) --- M2/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/configure.ac b/M2/configure.ac index 573fbeea5b5..ac8357cb614 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -1063,7 +1063,7 @@ AS_IF([test $BUILD_normaliz = no], BUILD_normaliz=yes])]) AS_IF([test $BUILD_normaliz = yes], - [BUILTLIBS="-lnormaliz -fopenmp $BUILTLIBS"]) + [BUILTLIBS="-lnormaliz $OPENMP_CXXFLAGS $OPENMP_LIBS $BUILTLIBS"]) if test "$BUILD_nauty" = no then dnl debian/fedora: nauty- From cd8c908cf0fa1bb822af273154c83d44aabf36e5 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Wed, 16 Oct 2024 03:29:11 +0200 Subject: [PATCH 054/226] prioritized usr-host over other prefixes --- M2/cmake/configure.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/cmake/configure.cmake b/M2/cmake/configure.cmake index e2fb1a06306..30bc3708fad 100644 --- a/M2/cmake/configure.cmake +++ b/M2/cmake/configure.cmake @@ -139,7 +139,7 @@ set(ENV{PKG_CONFIG_PATH} ${M2_HOST_PREFIX}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}) ## Setting the prefixes where CMake will look for headers, libraries, and programs set(CMAKE_SYSTEM_PREFIX_PATH ${M2_HOST_PREFIX} ${CMAKE_SYSTEM_PREFIX_PATH}) -set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${M2_HOST_PREFIX}) +set(CMAKE_PREFIX_PATH ${M2_HOST_PREFIX} ${CMAKE_PREFIX_PATH}) ## Setting the folder for Macaulay2 Core and packages set(CMAKE_INSTALL_DATADIR share/Macaulay2) From 9138855f325020e237540fcf2fe9252b67e6d446 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Wed, 16 Oct 2024 04:05:19 +0200 Subject: [PATCH 055/226] changed cmake to build normaliz without e-antic --- M2/cmake/build-libraries.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/M2/cmake/build-libraries.cmake b/M2/cmake/build-libraries.cmake index 876ef245b5b..2ad7429eea4 100644 --- a/M2/cmake/build-libraries.cmake +++ b/M2/cmake/build-libraries.cmake @@ -979,6 +979,7 @@ ExternalProject_Add(build-normaliz --without-flint # ${FLINT_ROOT} --without-nauty --without-cocoalib + --without-e-antic "CPPFLAGS=${CPPFLAGS} -I${GMP_INCLUDE_DIRS}" CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS} From 5cb6e819a15ee4b9bc915815da3fc6b05d067e92 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Wed, 16 Oct 2024 04:22:56 +0200 Subject: [PATCH 056/226] changed cmake to build normaliz with C++14 [ci skip] --- M2/cmake/build-libraries.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/cmake/build-libraries.cmake b/M2/cmake/build-libraries.cmake index 2ad7429eea4..d2c7c92b145 100644 --- a/M2/cmake/build-libraries.cmake +++ b/M2/cmake/build-libraries.cmake @@ -982,7 +982,7 @@ ExternalProject_Add(build-normaliz --without-e-antic "CPPFLAGS=${CPPFLAGS} -I${GMP_INCLUDE_DIRS}" CFLAGS=${CFLAGS} - CXXFLAGS=${CXXFLAGS} + "CXXFLAGS=${CXXFLAGS} -std=gnu++14" "LDFLAGS=${LDFLAGS} -L${GMP_LIBRARY_DIRS}" CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} From 61fe212c1563a151d52ae063b628ebf4450ab20c Mon Sep 17 00:00:00 2001 From: Federico Galetto Date: Tue, 15 Oct 2024 14:38:21 -0400 Subject: [PATCH 057/226] jets package updated to version 1.2 --- M2/Macaulay2/packages/Jets.m2 | 265 ++++++++++++++++-- M2/Macaulay2/packages/Macaulay2Doc/changes.m2 | 5 + 2 files changed, 253 insertions(+), 17 deletions(-) diff --git a/M2/Macaulay2/packages/Jets.m2 b/M2/Macaulay2/packages/Jets.m2 index 071c32d0363..d90a3ac64d7 100644 --- a/M2/Macaulay2/packages/Jets.m2 +++ b/M2/Macaulay2/packages/Jets.m2 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------------- --- Copyright 2021-2022 Federico Galetto, Nicholas Iammarino +-- Copyright 2021-2024 Federico Galetto, Nicholas Iammarino -- -- This program is free software: you can redistribute it and/or modify it under -- the terms of the GNU General Public License as published by the Free Software @@ -17,8 +17,8 @@ newPackage( "Jets", - Version => "1.1", - Date => "June 10, 2022", + Version => "1.2", + Date => "October 15, 2024", AuxiliaryFiles => true, Authors => { { @@ -54,7 +54,7 @@ newPackage( -importFrom(MinimalPrimes, {"radical"}); +importFrom(MinimalPrimes, {"radical","minimalPrimes"}); export { "JJ", @@ -69,7 +69,9 @@ export { "jetsProjection", "jetsInfo", "principalComponent", - "Saturate" + "Saturate", + "liftingFunction", + "liftingMatrix" } jetsOptions = { @@ -354,7 +356,7 @@ jets(ZZ,HyperGraph) := HyperGraph => o -> (n,G) -> ( hyperGraph E ) -jets(ZZ,AffineVariety) := o -> (n,V) -> ( +jets(ZZ,AffineVariety) := Variety => o -> (n,V) -> ( if n<0 then error("jets order must be a non-negative integer"); R := ring V; JR := jets(n,R,Projective=> o.Projective); @@ -417,9 +419,30 @@ JJ = new ScriptedFunctor from { --compute an ideal whose vanishing locus is the --principal component of the jets of an ideal +--changed in v1.2 with a faster algorithm for monomial ideals +--and to fix the behavior for reducible varieties +-- FG's note: I tried an option for bypassing the computation +-- of minimal primes, but for some reason this method appears to +-- work faster if minimal primes are found first +-- (at least for 2x2 minors of a generic 3x3 matrix) principalComponent = method(Options=>{Saturate=>true},TypicalValue=>Ideal) principalComponent(ZZ,Ideal) := o -> (n,I) -> ( if n<0 then error("jets order must be a non-negative integer"); + -- find minimal primes + mp := minimalPrimes I; + -- for a monomial ideal use shortcut from Galetto-Iammarino-Yu + if isMonomialIdeal(I) then ( + return intersect(apply(mp, P -> jets(n,P))); + ); + -- compute the singular locus of I by breaking up components + -- and finding singular locus of each + -- (this is necessary as of v1.24.05 because the singularLocus + -- method only works for irreducible ideals) + singComp := apply(mp, P -> ideal singularLocus P); + -- then also intersect components two at a time + pairwiseInt := apply(subsets(mp,2),sum); + -- and finally take the union + sing := intersect(singComp|pairwiseInt); -- compute jets of I JI := jets(n,I); -- get the jets projection @@ -427,20 +450,52 @@ principalComponent(ZZ,Ideal) := o -> (n,I) -> ( p := jetsProjection(n,0,R); -- identify original ambient ring with 0-jets i := map(source p,R,vars source p); - --compute the singular locus of I - --map it to the zero jets via the map i + --map the singular locus to the zero jets via the map i --then to the n jets via the map p - sing := p(i(ideal singularLocus I)); + sing0 := p i sing; --default is to saturate JI wrt sing if o.Saturate then ( - saturate(JI,sing) + saturate(JI,sing0) ) --if JI is radical, colon is enough else ( - JI:sing + JI:sing0 ) ) +-- the following methods (liftingFunction, liftingMatrix) +-- follow the definitions in the paper by Galetto-Iammarino-Yu +-- unexported recursive computation of lifting function +lf = (s,j,k) -> ( + -- deal with edge cases + if (k(s+1)*j) then return 0_ZZ; + if (k==j) then return ((s+1)^j)_ZZ; + if (k==(s+1)*j) then return 1_ZZ; + -- recursive computation + sum(min(k,s+1), i -> binomial(s+1,i+1) * mlf(s,j-1,k-i-1) ) + ) + +-- speeds up computation by storing values +mlf = memoize lf + +-- lifting function method for user +liftingFunction = method(TypicalValue => ZZ); +liftingFunction(ZZ,ZZ,ZZ) := ZZ => (s,j,k) -> ( + -- check arguments are nonnegative + if (s<0 or j<0 or k<0) then error("arguments should be nonnegative"); + mlf(s,j,k) + ) + +-- enter values of lifting function in a matrix +-- row/column indices start at zero +liftingMatrix = method(TypicalValue => Matrix); +liftingMatrix(ZZ,ZZ,ZZ) := Matrix => (s,r,c) -> ( + -- check arguments are nonnegative + if (s<0) then error("first argument should be nonnegative"); + if (r<=0 or c<=0) then error("second and third argument should be positive"); + matrix table(r,c, (j,k) -> mlf(s,j,k) ) + ) + beginDocumentation() ---------------------------------------------------------------------- -- TESTS @@ -547,6 +602,22 @@ TEST /// p = jetsProjection(3,1,R) assert(ring p JI === jets(3,R)) /// + +-- for lifting function +TEST /// + M=matrix{{1,0,0,0,0,0,0,0,0}, + {0,2,1,0,0,0,0,0,0}, + {0,0,4,4,1,0,0,0,0}, + {0,0,0,8,12,6,1,0,0}, + {0,0,0,0,16,32,24,8,1}} + assert(liftingMatrix(1,5,9) === M) + N=matrix{{1,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,3,3,1,0,0,0,0,0,0,0,0,0}, + {0,0,9,18,15,6,1,0,0,0,0,0,0}, + {0,0,0,27,81,108,81,36,9,1,0,0,0}, + {0,0,0,0,81,324,594,648,459,216,66,12,1}} + assert(liftingMatrix(2,5,13) === N) +/// ---------------------------------------------------------------------- -- Documentation ---------------------------------------------------------------------- @@ -571,29 +642,42 @@ Node the radical of jets of monomial ideals, a function to construct jets of graphs, a method for principal components of jets, and an option for jets with "projective" gradings. + + @HEADER4 "Version history:"@ + + @UL {(BOLD "1.1: ", "JSAG version."), + (BOLD "1.2: ", "Improved method for principal components. + Added methods for invariants of principal components + of monomial ideals.") + }@ References @arXiv("math/0612862","L. Ein and M. Mustaţă, Jet schemes and singularities.")@ - - @arXiv("2104.08933","F. Galetto, E. Helmick, and M. Walsh, - Jet graphs.")@ + + @arXiv("math/0407113","P. Vojta, + Jets via Hasse-Schmidt Derivations.")@ @HREF("https://doi.org/10.1080/00927870500454927", "R.A. Goward and K.E. Smith, The jet scheme of a monomial scheme.")@ - - @arXiv("math/0407113","P. Vojta, - Jets via Hasse-Schmidt Derivations.")@ + + @arXiv("2104.08933","F. Galetto, E. Helmick, and M. Walsh, + Jet graphs.")@ + + @arXiv("2407.01836","F. Galetto, N. Iammarino, and T. Yu, + Jets and principal components of monomial ideals, and very well-covered graphs")@ Subnodes :Package methods jets jetsProjection jetsRadical principalComponent + liftingFunction :Examples from the literature "Example 1" "Example 2" "Example 3" + "Example 4" :Technical information "Storing Computations" @@ -1226,6 +1310,11 @@ Node P = primaryDecomposition jets(2,I) any(P,c -> c == PC) PC == intersect(select(P,c -> degree c == 1)) + Text + If $I$ is a monomial ideal, this method uses a different characterization + of the principal component (see Theorem 6.7 in + @arXiv("2407.01836","F. Galetto, N. Iammarino, and T. Yu, + Jets and principal components of monomial ideals, and very well-covered graphs")@). Caveat This function requires computation of a singular locus, a saturation (or quotient), and jets, with each step being @@ -1263,6 +1352,82 @@ Node JJ_2 R JJ_2 I +Node + Key + liftingFunction + (liftingFunction,ZZ,ZZ,ZZ) + Headline + compute values of a lifting function + Usage + liftingFunction(s,j,k) + Inputs + s:ZZ + a natural number + j:ZZ + a natural number + k:ZZ + a natural number + Outputs + :ZZ + the number of cardinality $k$ lifts of a cardinality $j$ set under depolarization + Description + Text + This function was added in version 1.2 of the package @TO Jets@. + + Given a set $X$ and a natural number $s$, let $\mathcal{J}_s (X)$ + be the set that contains the elements $x_0,\dots,x_s$ for every + element $x\in X$. The @EM "depolarization"@ map + $\delta_s \colon \mathcal{J}_s (X)\to X$ is defined by + $\delta_s (x_i) = x$ for every $x\in X$ and $i\in \{0,\dots,s\}$. + + The @EM "lifting function"@ $l_s (j,k)$ counts the number + of subsets $V\subseteq \mathcal{J}_s (X)$ of cardinality $k$ + such that $\delta_s (V) = U$, where $U\subseteq X$ is a fixed + subset of cardinality $j$. Note that this number does not + depend on $U$ but only on its cardinality. + See @arXiv("2407.01836","F. Galetto, N. Iammarino, and T. Yu, + Jets and principal components of monomial ideals, and very well-covered graphs")@ + for computing this function. + Example + liftingFunction(1,2,3) + liftingFunction(2,2,3) + liftingFunction(1,3,2) + liftingFunction(1,0,0) + Text + For uses of the lifting function, see @TO "Example 4"@. + Subnodes + liftingMatrix + +Node + Key + liftingMatrix + (liftingMatrix,ZZ,ZZ,ZZ) + Headline + arrange values of lifting function in a matrix + Usage + liftingMatrix(s,r,c) + Inputs + s:ZZ + a natural number + r:ZZ + a positive integer + c:ZZ + a positive integer + Outputs + :Matrix + @TT "r"@ by @TT "c"@, whose entries are the values of the order @TT "s"@ lifting function + Description + Text + This function was added in version 1.2 of the package @TO Jets@. + + This function collects the values of the @TO "liftingFunction"@ + $l_s (j,k)$ and arranges them in an @TT "r"@ by @TT "c"@ matrix $L_s (j,k)$ + with row index $j\geqslant 0$ and column index $k\geqslant 0$. + Example + liftingMatrix(2,3,5) + Text + For uses of the lifting matrix, see @TO "Example 4"@. + Node Key "Example 1" @@ -1432,5 +1597,71 @@ Node Example apply({P_0,I2}, X -> hilbertSeries(X,Reduce=>true)) numerator (first oo) == (numerator last oo)^2 + +Node + Key + "Example 4" + Headline + invariants of principal jets of monomial ideals + Description + Text + This follows Examples 7.5 and 7.7 in + @arXiv("2407.01836","F. Galetto, N. Iammarino, and T. Yu, + Jets and principal components of monomial ideals, and very well-covered graphs")@. + + Consider the following squarefree monomial ideal in a standard graded polynomial ring. + Example + R = QQ[v..z] + I = ideal(v*w*x,x*y,y*z) + Text + This is the Stanley-Reisner ideal of a simplicial complex $\Delta$ + whose $f$-vector we compute below. + Example + needsPackage "SimplicialComplexes" + Δ = simplicialComplex I + f = matrix{fVector(Δ)} + Text + Next, we construct the ideal $\mathcal{P}_1 (I)$ of principal 1-jets of $I$ + (see @TO "principalComponent"@ for details). + This is also the Stanley-Reisner ideal of a simplicial complex + $\Gamma_1$ and we can compute its $f$-vector. + Example + P1 = principalComponent(1,I) + phi = last flattenRing ring P1; + Γ1 = simplicialComplex phi P1 + F = matrix{fVector Γ1} + Text + The $f$-vector of $\Gamma_1$ can be obtained by multiplying + the $f$-vector of $\Delta$ with a @TO "liftingMatrix"@ of the + appropriate size. + Example + L = liftingMatrix(1,4,7) + F == f*L + Text + There is a similar relation between the Betti numbers of + the Stanley-Reisner rings $\Bbbk [\Delta]$ + and $\Bbbk [\Gamma_1]$. First, we compute the Betti + diagram of $\Bbbk [\Delta]$ and turn it into a matrix by + sliding the $i$-th row $i$ units to the right. + Example + betti res I + b = mutableMatrix(ZZ,3,5); + scanPairs(betti res I, (k,v) -> b_(k_2-k_0,k_2) = v); + b = matrix b + Text + Next, we do the same with the Betti diagram of $\Bbbk [\Gamma_1]$. + Example + betti res P1 + B = mutableMatrix(ZZ,3,9); + scanPairs(betti res P1, (k,v) -> B_(k_2-k_0,k_2) = v); + B = matrix B + Text + The matrix containing the Betti numbers of $\Bbbk [\Gamma_1]$ + can be obtained by multiplying the matrix containing the Betti + numbers of $\Bbbk [\Delta]$ with a @TO "liftingMatrix"@ of the + appropriate size. + Example + L = liftingMatrix(1,5,9) + B == b*L /// end diff --git a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 index 1177a29e089..49ca22bec16 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 @@ -47,6 +47,11 @@ document { UL { LI { "The function ", TO remove, ", which previously had no return value, now returns the value that was removed." } } + }, + LI { "improved packages:", + UL { + LI { TO "Jets::Jets", " has been updated to version 1.2 with improvements and new methods for principal jets."}, + } } } } From dec19840901ec20c315311feee7aeea86983eb08 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 16 Oct 2024 12:04:52 -0400 Subject: [PATCH 058/226] Print stack trace when flint aborts --- M2/Macaulay2/bin/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/M2/Macaulay2/bin/main.cpp b/M2/Macaulay2/bin/main.cpp index 41b3c392c90..fa4c8540cf2 100644 --- a/M2/Macaulay2/bin/main.cpp +++ b/M2/Macaulay2/bin/main.cpp @@ -23,6 +23,7 @@ #include #include #include +#include // for flint_set_abort /* ######################################################################### */ @@ -54,6 +55,7 @@ bool interrupts_interruptShield; void* interpFunc(ArgCell* vargs); void* profFunc(ArgCell* p); void* testFunc(ArgCell* p); +void M2_flint_abort(void); static void * GC_start_performance_measurement_0(void *) { #ifdef GC_start_performance_measurement /* added in bdwgc 8 */ @@ -90,6 +92,8 @@ int main(/* const */ int argc, /* const */ char *argv[], /* const */ char *env[] signal(SIGPIPE,SIG_IGN); /* ignore the broken pipe signal */ + flint_set_abort(M2_flint_abort); + static struct ArgCell* M2_vargs; M2_vargs = (ArgCell*) GC_MALLOC_UNCOLLECTABLE(sizeof(struct ArgCell)); M2_vargs->argv = argv; /* argument vector */ @@ -134,6 +138,11 @@ void stack_trace(std::ostream &stream, bool M2) { } } +void M2_flint_abort(void) { + stack_trace(std::cerr, false); + abort(); +} + extern "C" { void M2_stack_trace() { stack_trace(std::cout, false); } #if PROFILING From 4d0415ebf0ffd920168921bfcbaf8c97f14467fb Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 15 Oct 2024 07:48:46 -0400 Subject: [PATCH 059/226] Replace Makefile with autogen.sh shell script We remove the various autotools version checks since they'll almost certainly pass (e.g., we were checking for GNU make 3.81, which was released in 2006). In particular, we now just call autoreconf to generate the configure script and update the M2-emacs submodule. --- M2/Makefile | 252 -------------------------------------------------- M2/autogen.sh | 19 ++++ 2 files changed, 19 insertions(+), 252 deletions(-) delete mode 100644 M2/Makefile create mode 100755 M2/autogen.sh diff --git a/M2/Makefile b/M2/Makefile deleted file mode 100644 index 5cb5f84e8bc..00000000000 --- a/M2/Makefile +++ /dev/null @@ -1,252 +0,0 @@ -# -*- makefile-gmake -*- - -# SHELL := /bin/bash -x - -.PHONY : all monitor check-make check-autoconf check-libtool check-automake - -.NOTPARALLEL: - -VERBOSE = yes - -all: check-make make-configure monitor include/M2/config.h.in.stamp check-automake check-autoconf check-libtool fetch-M2-emacs - -# libtool 2.4.3 is too old, 2.4.6 is okay, and we provide it -LIBTOOL_MAJOR = 2 -LIBTOOL_MINOR = 4 -LIBTOOL_BABY = 4 -LIBTOOL_VERSION = $(LIBTOOL_MAJOR).$(LIBTOOL_MINOR).$(LIBTOOL_BABY) - -AUTOCONF_MAJOR = 2 -AUTOCONF_MINOR = 68 -# version 2.60 was the first one with the macro AC_PROG_MKDIR_P -# version 2.62 is required by the configure.ac in gc/libatomic_ops -# version 2.68 is required by mpir 2.6.0 -AUTOCONF_VERSION = $(AUTOCONF_MAJOR).$(AUTOCONF_MINOR) - -# automake 1.15 is too old -AUTOMAKE_MAJOR = 1 -AUTOMAKE_MINOR = 16 -# version 1.12 was the first one with the macro AM_PROG_AR, used by memtailor -AUTOMAKE_VERSION = $(AUTOMAKE_MAJOR).$(AUTOMAKE_MINOR) - -export PATH := $(shell pwd)/usr-build/bin:$(PATH) - -check-make: - @ echo "$(.FEATURES)" | grep order-only >/dev/null || (echo error: version >= 3.81 of GNU make is required >&2; false) - @ echo GNU make version okay - -make-configure : check-autoconf configure -configure: configure.ac VERSION config/files config/*.m4 - rm -rf autom4te.cache - autoconf - -get-tools: usr-build/aclocal-path get-m4 get-autoconf get-automake get-libtool usr-build/aclocal-path2 which-tools -which-tools: - @ for i in m4 autoconf automake libtool; \ - do echo $$i: ; which $$i ; $$i --version | head -1 ; done - @ echo aclocal-path:; cat usr-build/aclocal-path - @ echo aclocal-path2:; cat usr-build/aclocal-path2 - @ echo aclocal_--print:; aclocal --print -usr-build/aclocal-path:; echo export ACLOCAL_PATH:="`aclocal --print-ac-dir`":'$$(ACLOCAL_PATH)' >$@ -usr-build/aclocal-path2:; echo export ACLOCAL_PATH:="`usr-build/bin/aclocal --print-ac-dir`":'$$(ACLOCAL_PATH)' >$@ -get-m4: - $(MAKE) -C usr-build -f Makefile.pkg LIBNAME=m4 VERSION=1.4.18 -get-autoconf: - $(MAKE) -C usr-build -f Makefile.pkg LIBNAME=autoconf VERSION=2.71 -get-automake: - $(MAKE) -C usr-build -f Makefile.pkg LIBNAME=automake VERSION=1.16.1 -get-libtool: - $(MAKE) -C usr-build -f Makefile.pkg LIBNAME=libtool VERSION=2.4.6 -get-automake: get-pkg -get-pkg: usr-build/share/aclocal/pkg.m4 -usr-build/aclocal-path2:get-automake -usr-build/share/aclocal/pkg.m4: usr-build/pkg.m4 - if [ ! -d usr-build/share ] ; then mkdir usr-build/share ; fi - if [ ! -d usr-build/share/aclocal ] ; then mkdir usr-build/share/aclocal ; fi - cp $^ $@ -clean-tools:; rm -rf usr-build/aclocal-path usr-build/aclocal-path2 usr-build/bin usr-build/include usr-build/lib usr-build/share usr-build/src usr-build/.compiled-* usr-build/.configured-* usr-build/.installed-* usr-build/.patched-* usr-build/.untarred-* - -autoconf-absent : autoconf-absent-msg autoconf-msg -autoconf-absent-msg : - @ echo "=============================================================================" >&2 - @ echo "error: the autoconf program is not installed on your system." >&2 - -autoconf-old : autoconf-old-msg autoconf-msg -autoconf-old-msg : - @ echo "=============================================================================" >&2 - @ echo "error: the autoconf program installed on your system (`type autoconf`) is too old." >&2 - -autoconf-msg : - @ echo "" >&2 - @ echo "Please install or update autoconf: the version (`autoconf --version | sed -e '1s/.*\([1-9][0-9]*\..*\)/\1/' -e '2,$$d'`) should be at least $(AUTOCONF_VERSION)." >&2 - @ $(MAKE) alternative-msg - -check-libtool: - @ type libtool >/dev/null || $(MAKE) -f Makefile libtool-absent - @ if `libtool --version >/dev/null 2>&1` ; \ - then MAJOR=`libtool --version | sed -e '1s/[^.]* \([1-9][0-9]*\)\..*/\1/' -e '2,$$d'` ; \ - MINOR=`libtool --version | sed -e '1s/[^.]*\.\([0-9]\{1,\}\)\..*/\1/' -e '2,$$d'` ; \ - BABY=` libtool --version | sed -e '1s/[^.]*\.[^.]*\.\([0-9]\{1,\}\).*/\1/' -e '2,$$d'` ; \ - if test "$$MAJOR" -gt "$(LIBTOOL_MAJOR)" \ - -o \( "$$MAJOR" = "$(LIBTOOL_MAJOR)" -a "$$MINOR" -gt "$(LIBTOOL_MINOR)" \) \ - -o \( $$MAJOR = $(LIBTOOL_MAJOR) -a $$MINOR = $(LIBTOOL_MINOR) -a $$BABY -ge $(LIBTOOL_BABY) \) ; \ - then echo "GNU libtool version ($$MAJOR.$$MINOR.$$BABY) okay" ; \ - else $(MAKE) -f Makefile libtool-old ; \ - fi \ - else $(MAKE) -f Makefile libtool-not-gnu ; \ - fi -libtool-absent : libtool-absent-msg libtool-msg -libtool-absent-msg : - @ echo "=============================================================================" >&2 - @ echo "error: the libtool program is not installed on your system." >&2 -libtool-old : libtool-old-msg libtool-msg -libtool-old-msg : - @ echo "=============================================================================" >&2 - @ echo "error: the libtool program installed on your system (`type libtool`) is too old." >&2 -libtool-not-gnu : libtool-not-gnu-msg libtool-msg -libtool-not-gnu-msg : - @ echo "=============================================================================" >&2 - @ echo "error: the libtool program installed on your system (`type libtool`) is not GNU." >&2 -libtool-msg : - @ echo "" >&2 - @ echo "Please install or update libtool: the version should be at least $(LIBTOOL_VERSION)." >&2 - @ $(MAKE) alternative-msg - -check-autoconf : - @ type autoconf >/dev/null || $(MAKE) -f Makefile autoconf-absent - @ if test "`autoconf --version | sed -e '1s/.* \([1-9][0-9]*\)\..*/\1/' -e '2,$$d'`" -gt "$(AUTOCONF_MAJOR)" \ - || \ - test "`autoconf --version | sed -e '1s/.* \([1-9][0-9]*\)\..*/\1/' -e '2,$$d'`" = "$(AUTOCONF_MAJOR)" \ - && \ - test "`autoconf --version | sed -e '1s/.*\.\([1-9][0-9]*\).*/\1/' -e '2,$$d'`" -ge "$(AUTOCONF_MINOR)" ;\ - then echo GNU autoconf version okay ;\ - else $(MAKE) -f Makefile autoconf-old ;\ - fi - -automake-absent : automake-absent-msg automake-msg -automake-absent-msg : - @ echo "=============================================================================" >&2 - @ echo "error: the automake program is not installed on your system." >&2 - - -automake-old : automake-old-msg automake-msg -automake-old-msg : - @ echo "=============================================================================" >&2 - @ echo "error: the automake program installed on your system (`type automake`) is too old." >&2 - -automake-msg : - @ echo "" >&2 - @ echo "Please install or update automake: the version (`automake --version | sed -e '1s/.* \(.*\)/\1/' -e '2,$$d'`) should be at least $(AUTOMAKE_VERSION)." >&2 - @ $(MAKE) alternative-msg - -alternative-msg: - @ echo "" >&2 - @ echo "Alternatively, run the command" >&2 - @ echo "" >&2 - @ echo " make get-tools" >&2 - @ echo "" >&2 - @ echo "for recent versions of m4, autoconf, automake, and libtool to be downloaded and compiled automatically," >&2 - @ echo "or type one or more of the following commands:" >&2 - @ echo "" >&2 - @ echo " make get-m4" >&2 - @ echo " make get-autoconf" >&2 - @ echo " make get-automake" >&2 - @ echo " make get-libtool" >&2 - @ echo "=============================================================================" >&2 - @ false - -check-automake : - @ type automake >/dev/null || $(MAKE) -f Makefile automake-absent - @ if test "`automake --version | sed -e '1s/.* \([1-9][0-9]*\)\..*/\1/' -e '2,$$d'`" -gt "$(AUTOMAKE_MAJOR)" \ - || \ - test "`automake --version | sed -e '1s/.* \([1-9][0-9]*\)\..*/\1/' -e '2,$$d'`" = "$(AUTOMAKE_MAJOR)" \ - && \ - test "`automake --version | sed -e '1s/.* [1-9][0-9]*\.\([1-9][0-9]*\).*/\1/' -e '2,$$d'`" -ge "$(AUTOMAKE_MINOR)" ;\ - then echo GNU automake version okay ;\ - else $(MAKE) -f Makefile automake-old ;\ - fi - -# autoheader's job is to make include/config.h, but if there are no changes, it doesn't touch it, -# which means "make" will keep trying -include/M2/config.h.in.stamp : configure.ac # aclocal.m4 - autoheader - touch "$@" - -monitor: - @ if [ ! -f include/config.h.in -a -f include/config.h.in.stamp ]; then set -x; rm include/config.h.in.stamp; fi - -count count-source-code-lines: - find . \( \ - -name BUILD -prune -false -o \ - -name .svn -prune -false -o \ - -name bugs -prune -false -o \ - -name submodules -prune -false -o \ - -name autoconf-\* -prune -false -o \ - -name regex -prune -false -o \ - -name examples -prune -false -o \ - -name test -prune -false -o \ - -name TST -prune -false -o \ - -name EXA -prune -false -o \ - -name ComputationsBook -prune -false -o \ - -name basictests -prune -false -o \ - -name \*.m2 -o \ - -name \*.c -o \ - -name \*.h -o \ - -name \*.hpp -o \ - -name \*.cpp -o \ - -name configure.ac -o \ - -name Makefile.in -o \ - -name Makefile -o \ - -name GNUMakefile \) \ - -not -name bug\* \ - -not -name demo\* \ - -not -name test\* \ - | xargs wc -l > /tmp/$@-$$$$ && \ - egrep -v ' total$$' /tmp/$@-$$$$ && \ - egrep ' total$$' /tmp/$@-$$$$ && \ - egrep ' total$$' /tmp/$@-$$$$ | awk '{sum += $$1}; END { print sum, "grand total" }' && \ - rm /tmp/$@-$$$$ - - -SEARCH= -ifeq ($(SEARCH),) -grep : - @echo 'usage: make grep SEARCH="regexp"' >&2 - @false -else -grep : - find . \( -name .git -o -name BUILD -o -name autom4te.cache \) ! -prune -o -type f | xargs grep -nH -e $(SEARCH) || [ $$? = 123 ] -endif - -announce: - @ echo '-*- compilation; coding: utf-8 -*-' - @ echo ' -- Macaulay2 compilation:' - @ echo ' -- Paste this output into an emacs buffer and run M-x compilation-mode' - @ echo ' -- and then C-C ` (same as M-x next-error) to view the errors.' - -TAGS.config : config/files always - (echo configure.ac ; cat $< | sed 's/$$/.in/') | xargs etags -o $@ -always: - -diffs :;@ i=1 ; while test -f diffs-$$i ; do i=$$(expr $$i + 1 ) ; done ; svn diff >diffs-$$i ; echo created diffs-$$i - -check-vardirs: - egrep -nH '@(bin|data|include|info|lib|libexec|localstate|man|sbin|sharedstate|sysconf|ps|pdf|dvi|html|locale|doc|dataroot|packages|libm2|emacs|libraries|packagecachecore)dir@' $(shell cat ./config/files | sed 's/$$/.in/') -check-pre-vardirs: - egrep -nH '@pre_(bin|data|include|info|lib|libexec|localstate|man|sbin|sharedstate|sysconf|ps|pdf|dvi|html|locale|doc|dataroot|packages|libm2|emacs|libraries|packagecachecore)dir@' $(shell cat ./config/files | sed 's/$$/.in/') - -# The submodule fflas_ffpack scribbles in its source tree to record the current -# version number of libtool found on the system, in the file -# M2/submodules/fflas_ffpack/macros/ltversion.m4. This target will clean that up. -clean-in-submodules: - git submodule foreach git clean -xdfq - -# Fetch the M2-emacs submodule -fetch-M2-emacs: Macaulay2/editors/emacs/M2.el -Macaulay2/editors/emacs/M2.el: - cd .. && git submodule update --init M2/Macaulay2/editors/emacs - -# Local Variables: -# mode: Makefile -# compile-command: "make -f Makefile " -# End: diff --git a/M2/autogen.sh b/M2/autogen.sh new file mode 100755 index 00000000000..148021eac99 --- /dev/null +++ b/M2/autogen.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +echo "-- Generating configure script" +autoreconf --verbose --force --install + +if test ! -f Macaulay2/editors/emacs/M2.el +then + if test -e ../.git + then + echo "-- Updating M2-emacs submodule" + git submodule update --init Macaulay2/editors/emacs + else + echo "-- Warning: Not in a git repository; unable to update M2-emacs submodule." + echo "-- You may download it from https://github.com/Macaulay2/M2-emacs and extract" + echo "-- its contents to the Macaulay2/M2/emacs subdirectory." + fi +fi From f387e62a985dd3c94bc4b7c7070064d669332306 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 15 Oct 2024 08:04:57 -0400 Subject: [PATCH 060/226] Rename GNUmakefile.in -> Makefile.in For consistency since Makefile has been replaced w/ autogen.sh. --- M2/.gitignore | 2 +- M2/BUILD/build/.gitignore | 2 +- M2/Macaulay2/m2/Makefile.in | 2 +- M2/{GNUmakefile.in => Makefile.in} | 4 ++-- M2/config/files | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename M2/{GNUmakefile.in => Makefile.in} (99%) diff --git a/M2/.gitignore b/M2/.gitignore index d90ff768942..2fce540e15e 100644 --- a/M2/.gitignore +++ b/M2/.gitignore @@ -5,7 +5,7 @@ /config.status /include/M2/config.h /srcdir -/GNUmakefile +/Makefile /check-configure/Makefile /include/config.Makefile /include/configuration diff --git a/M2/BUILD/build/.gitignore b/M2/BUILD/build/.gitignore index 38a5dd2d827..3e4484f88d6 100644 --- a/M2/BUILD/build/.gitignore +++ b/M2/BUILD/build/.gitignore @@ -1,4 +1,4 @@ -GNUmakefile +Makefile Macaulay2 check-configure config.args diff --git a/M2/Macaulay2/m2/Makefile.in b/M2/Macaulay2/m2/Makefile.in index f3bdb24c7e8..58f90cf4ae9 100644 --- a/M2/Macaulay2/m2/Makefile.in +++ b/M2/Macaulay2/m2/Makefile.in @@ -55,7 +55,7 @@ clean::; rm -f TAGS @srcdir@/TAGS @srcdir@/TAGS.doc ../tests/slow/Makefile.in \ ../tests/engine/Makefile.in \ ../packages/Makefile.in \ - ../../Makefile ../../GNUmakefile.in + ../../Makefile.in : making $@ @ set -e ; \ cd @srcdir@ && \ diff --git a/M2/GNUmakefile.in b/M2/Makefile.in similarity index 99% rename from M2/GNUmakefile.in rename to M2/Makefile.in index c36fc1275d7..706982acf42 100644 --- a/M2/GNUmakefile.in +++ b/M2/Makefile.in @@ -10,7 +10,7 @@ all install: \ M2 all-in-subdirs report-M2-location configured-files: @CONFIGURED_FILES@ $(foreach f,@CONFIGURED_FILES@,$(eval $f: @srcdir@/$f.in; ./config.status $f)) -M2: GNUmakefile +M2: rm -f M2 (echo '#! /bin/sh'; echo 'exec @pre_bindir@/M2 "$$@"') >M2 chmod a+x M2 @@ -83,7 +83,7 @@ status: @srcdir@/configure @echo '# to run it that way again.' @echo '#' @echo '-----------------------------------------------------------------------------' -srcdir: GNUmakefile +srcdir: : creating or removing symbolic link to common staging area, if necessary, : based on comparison of these directories: : pre_prefix : @pre_prefix@ diff --git a/M2/config/files b/M2/config/files index dc4effd9269..49591730ddf 100644 --- a/M2/config/files +++ b/M2/config/files @@ -1,4 +1,4 @@ -GNUmakefile +Makefile check-configure/Makefile include/config.Makefile include/configuration From ebae240c69b2adad681e70b4506c2b394721eb2b Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 15 Oct 2024 08:09:48 -0400 Subject: [PATCH 061/226] Call autogen.sh in GitHub builds --- .github/workflows/test_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_build.yml b/.github/workflows/test_build.yml index 66bec447d29..2d58a951ce3 100644 --- a/.github/workflows/test_build.yml +++ b/.github/workflows/test_build.yml @@ -154,7 +154,7 @@ jobs: - name: Configure Macaulay2 using Autotools if: matrix.build-system == 'autotools' run: | - make -C ../.. all + pushd ../.. && ./autogen.sh && popd export PYVERSION=`python3 -c "from sys import version_info; \ print(f'{version_info.major}.{version_info.minor}')"` export CPPFLAGS="-I`brew --prefix`/include -I`brew --prefix libomp`/include" From 4a3d384a9f4c9e57f7145fe68d8fa8ce931e555c Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 15 Oct 2024 08:14:10 -0400 Subject: [PATCH 062/226] Remove autotools-generated config files from git Also remove the call to AC_CONFIG_AUX_DIR so they aren't generated in the config subdirectory, add them to .gitignore, and remove config/Makefile, which was used to download them. --- M2/.gitignore | 3 + M2/BUILD/dan/Makefile | 2 +- M2/BUILD/dan/Makefile.include | 2 +- M2/Makefile.in | 2 +- M2/config/Makefile | 10 - M2/config/config.guess | 1667 ------------------------------ M2/config/config.sub | 1793 --------------------------------- M2/config/install-sh | 251 ----- M2/configure.ac | 2 - 9 files changed, 6 insertions(+), 3726 deletions(-) delete mode 100644 M2/config/Makefile delete mode 100755 M2/config/config.guess delete mode 100755 M2/config/config.sub delete mode 100755 M2/config/install-sh diff --git a/M2/.gitignore b/M2/.gitignore index 2fce540e15e..d4646a1cf2a 100644 --- a/M2/.gitignore +++ b/M2/.gitignore @@ -3,6 +3,9 @@ /config.args /config.log /config.status +/config.guess +/config.sub +/install-sh /include/M2/config.h /srcdir /Makefile diff --git a/M2/BUILD/dan/Makefile b/M2/BUILD/dan/Makefile index 722109aa10c..3046b4cf431 100644 --- a/M2/BUILD/dan/Makefile +++ b/M2/BUILD/dan/Makefile @@ -40,7 +40,7 @@ CONFIGOPTIONS += --with-python endif # We may distribute the result, so prevent aggressive optimizations based on the current architecture: -CONFIGOPTIONS += --build=$(shell ../../config/config.guess) +CONFIGOPTIONS += --build=$(shell ../../config.guess) ifeq ($(MACOSX),yes) # # if we don't do this, we may get an absolute path in currentLayout: diff --git a/M2/BUILD/dan/Makefile.include b/M2/BUILD/dan/Makefile.include index 581cb650656..5ff6894fd03 100644 --- a/M2/BUILD/dan/Makefile.include +++ b/M2/BUILD/dan/Makefile.include @@ -68,7 +68,7 @@ CONFIGOPTIONS += CC="$(CC)" CXX="$(CXX)" FC="$(FC)" AR="$(AR)" CPPFLAGS="$(CPPFL AM_DEFAULT_VERBOSITY = 1 PREFIX ?= /usr CONFIGOPTIONS += --prefix=$(PREFIX) -CONFIGOPTIONS += --build=$(shell ../../config/config.guess) +CONFIGOPTIONS += --build=$(shell ../../config.guess) # Local Variables: # compile-command: "time make -f Makefile.include find-M2 DIRECTORY=none" # End: diff --git a/M2/Makefile.in b/M2/Makefile.in index 706982acf42..132309538bf 100644 --- a/M2/Makefile.in +++ b/M2/Makefile.in @@ -105,7 +105,7 @@ srcdir: subst: config.status ; ./config.status show: config.status <$< sed -e 's/\\\n//' |egrep '^[SD]\["' | sed -e 's/^S."\(.*\)"\]="\(.*\)"$$/\1=\2/' -e 's/^D."\(.*\)"\]="\(.*\)"$$/#define \1 \2/' -e 's/\\"/"/g' -CONFIG_FILES = @srcdir@/configure @srcdir@/config/install-sh @srcdir@/config/config.sub @srcdir@/config/config.guess @srcdir@/config/files +CONFIG_FILES = @srcdir@/configure @srcdir@/install-sh @srcdir@/config.sub @srcdir@/config.guess @srcdir@/config/files reconfigure-top-only: recheck check-for-undefined-configure-variables protect-configs protect-configs: @ chmod a-w $(shell cat @srcdir@/config/files) diff --git a/M2/config/Makefile b/M2/config/Makefile deleted file mode 100644 index 39241794b32..00000000000 --- a/M2/config/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# the files config.guess and config.sub used be at /ftp@ftp.gnu.org:/gnu/config/, but now the -# README file there tells where to get them instead - -guess: - ./config.guess -update: - rm -f config.guess* config.sub* - wget -O config.guess "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" - wget -O config.sub "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" - chmod a+x config.sub config.guess diff --git a/M2/config/config.guess b/M2/config/config.guess deleted file mode 100755 index 45001cfecde..00000000000 --- a/M2/config/config.guess +++ /dev/null @@ -1,1667 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2020 Free Software Foundation, Inc. - -timestamp='2020-01-01' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. -# -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess -# -# Please send patches to . - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2020 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -tmp= -# shellcheck disable=SC2172 -trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 - -set_cc_for_build() { - # prevent multiple calls if $tmp is already set - test "$tmp" && return 0 - : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } - dummy=$tmp/dummy - case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in - ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do - if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" - break - fi - done - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; - esac -} - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if test -f /.attbin/uname ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case "$UNAME_SYSTEM" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - set_cc_for_build - cat <<-EOF > "$dummy.c" - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" - - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl - fi - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - "/sbin/$sysctl" 2>/dev/null || \ - "/usr/sbin/$sysctl" 2>/dev/null || \ - echo unknown)` - case "$UNAME_MACHINE_ARCH" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - earmv*) - arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine="${arch}${endian}"-unknown - ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently (or will in the future) and ABI. - case "$UNAME_MACHINE_ARCH" in - earm*) - os=netbsdelf - ;; - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in - earm*) - expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "$UNAME_VERSION" in - Debian*) - release='-gnu' - ;; - *) - release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; - *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; - *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; - *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; - *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; - *:OS108:*:*) - echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; - *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; - *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; - *:Twizzler:*:*) - echo "$UNAME_MACHINE"-unknown-twizzler - exit ;; - *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; - mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE=alpha ;; - "EV4.5 (21064)") - UNAME_MACHINE=alpha ;; - "LCA4 (21066/21068)") - UNAME_MACHINE=alpha ;; - "EV5 (21164)") - UNAME_MACHINE=alphaev5 ;; - "EV5.6 (21164A)") - UNAME_MACHINE=alphaev56 ;; - "EV5.6 (21164PC)") - UNAME_MACHINE=alphapca56 ;; - "EV5.7 (21164PC)") - UNAME_MACHINE=alphapca57 ;; - "EV6 (21264)") - UNAME_MACHINE=alphaev6 ;; - "EV6.7 (21264A)") - UNAME_MACHINE=alphaev67 ;; - "EV6.8CB (21264C)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8AL (21264B)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8CX (21264D)") - UNAME_MACHINE=alphaev68 ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE=alphaev69 ;; - "EV7 (21364)") - UNAME_MACHINE=alphaev7 ;; - "EV7.9 (21364A)") - UNAME_MACHINE=alphaev79 ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - set_cc_for_build - SUN_ARCH=i386 - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH=x86_64 - fi - fi - echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" - ;; - sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`"$dummy" "$dummyarg"` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] - then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] - then - echo m88k-dg-dgux"$UNAME_RELEASE" - else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" - fi - else - echo i586-dg-dgux"$UNAME_RELEASE" - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" - fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` - else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" - fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - case "$UNAME_MACHINE" in - 9000/31?) HP_ARCH=m68000 ;; - 9000/[34]??) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "$sc_cpu_version" in - 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 - 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "$sc_kernel_bits" in - 32) HP_ARCH=hppa2.0n ;; - 64) HP_ARCH=hppa2.0w ;; - '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "$HP_ARCH" = "" ]; then - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ "$HP_ARCH" = hppa2.0w ] - then - set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH=hppa2.0w - else - HP_ARCH=hppa64 - fi - fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux"$HPUX_REV" - exit ;; - 3050*:HI-UX:*:*) - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo "$UNAME_MACHINE"-unknown-osf1mk - else - echo "$UNAME_MACHINE"-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; - *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; - arm:FreeBSD:*:*) - UNAME_PROCESSOR=`uname -p` - set_cc_for_build - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi - else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf - fi - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case "$UNAME_PROCESSOR" in - amd64) - UNAME_PROCESSOR=x86_64 ;; - i386) - UNAME_PROCESSOR=i586 ;; - esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; - i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; - *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; - *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; - *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; - i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; - *:Interix*:*) - case "$UNAME_MACHINE" in - x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; - IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; - esac ;; - i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-pc-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; - *:GNU:*:*) - # the GNU system - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" - exit ;; - *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix - exit ;; - aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arm*:Linux:*:*) - set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi - else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; - crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; - e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; - ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - set_cc_for_build - IS_GLIBC=0 - test x"${LIBC}" = xgnu && IS_GLIBC=1 - sed 's/^ //' << EOF > "$dummy.c" - #undef CPU - #undef mips - #undef mipsel - #undef mips64 - #undef mips64el - #if ${IS_GLIBC} && defined(_ABI64) - LIBCABI=gnuabi64 - #else - #if ${IS_GLIBC} && defined(_ABIN32) - LIBCABI=gnuabin32 - #else - LIBCABI=${LIBC} - #endif - #endif - - #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 - CPU=mipsisa64r6 - #else - #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 - CPU=mipsisa32r6 - #else - #if defined(__mips64) - CPU=mips64 - #else - CPU=mips - #endif - #endif - #endif - - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - MIPS_ENDIAN=el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - MIPS_ENDIAN= - #else - MIPS_ENDIAN= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" - test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } - ;; - mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; - or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; - sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; - x86_64:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; - xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; - i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; - i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; - i*86:*:4.*:*) - UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" - else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" - else - echo "$UNAME_MACHINE"-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configure will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo "$UNAME_MACHINE"-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv"$UNAME_RELEASE" - else - echo mips-unknown-sysv"$UNAME_RELEASE" - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; - SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; - *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` - case $UNAME_PROCESSOR in - unknown) UNAME_PROCESSOR=powerpc ;; - esac - if command -v xcode-select > /dev/null 2> /dev/null && \ - ! xcode-select --print-path > /dev/null 2> /dev/null ; then - # Avoid executing cc if there is no toolchain installed as - # cc will be a stub that puts up a graphical alert - # prompting the user to install developer tools. - CC_FOR_BUILD=no_compiler_found - else - set_cc_for_build - fi - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc - if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_PPC >/dev/null - then - UNAME_PROCESSOR=powerpc - fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # uname -m returns i386 or x86_64 - UNAME_PROCESSOR=$UNAME_MACHINE - fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = x86; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - # shellcheck disable=SC2154 - if test "$cputype" = 386; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; - *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "$UNAME_MACHINE" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" - exit ;; - i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; - i*86:AROS:*:*) - echo "$UNAME_MACHINE"-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; - amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; - *:Unleashed:*:*) - echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" - exit ;; -esac - -# No uname command or uname output not recognized. -set_cc_for_build -cat > "$dummy.c" < -#include -#endif -#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) -#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) -#include -#if defined(_SIZE_T_) || defined(SIGLOST) -#include -#endif -#endif -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); -#endif - -#if defined (vax) -#if !defined (ultrix) -#include -#if defined (BSD) -#if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -#else -#if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -#else - printf ("vax-dec-bsd\n"); exit (0); -#endif -#endif -#else - printf ("vax-dec-bsd\n"); exit (0); -#endif -#else -#if defined(_SIZE_T_) || defined(SIGLOST) - struct utsname un; - uname (&un); - printf ("vax-dec-ultrix%s\n", un.release); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif -#endif -#endif -#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) -#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) -#if defined(_SIZE_T_) || defined(SIGLOST) - struct utsname *un; - uname (&un); - printf ("mips-dec-ultrix%s\n", un.release); exit (0); -#else - printf ("mips-dec-ultrix\n"); exit (0); -#endif -#endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. -test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } - -echo "$0: unable to guess system type" >&2 - -case "$UNAME_MACHINE:$UNAME_SYSTEM" in - mips:Linux | mips64:Linux) - # If we got here on MIPS GNU/Linux, output extra information. - cat >&2 <&2 </dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = "$UNAME_MACHINE" -UNAME_RELEASE = "$UNAME_RELEASE" -UNAME_SYSTEM = "$UNAME_SYSTEM" -UNAME_VERSION = "$UNAME_VERSION" -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/M2/config/config.sub b/M2/config/config.sub deleted file mode 100755 index f02d43ad500..00000000000 --- a/M2/config/config.sub +++ /dev/null @@ -1,1793 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2020 Free Software Foundation, Inc. - -timestamp='2020-01-01' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS - -Canonicalize a configuration name. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2020 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo "$1" - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Split fields of configuration type -# shellcheck disable=SC2162 -IFS="-" read field1 field2 field3 field4 <&2 - exit 1 - ;; - *-*-*-*) - basic_machine=$field1-$field2 - os=$field3-$field4 - ;; - *-*-*) - # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two - # parts - maybe_os=$field2-$field3 - case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ - | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) - basic_machine=$field1 - os=$maybe_os - ;; - android-linux) - basic_machine=$field1-unknown - os=linux-android - ;; - *) - basic_machine=$field1-$field2 - os=$field3 - ;; - esac - ;; - *-*) - # A lone config we happen to match not fitting any pattern - case $field1-$field2 in - decstation-3100) - basic_machine=mips-dec - os= - ;; - *-*) - # Second component is usually, but not always the OS - case $field2 in - # Prevent following clause from handling this valid os - sun*os*) - basic_machine=$field1 - os=$field2 - ;; - # Manufacturers - dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ - | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ - | unicom* | ibm* | next | hp | isi* | apollo | altos* \ - | convergent* | ncr* | news | 32* | 3600* | 3100* \ - | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ - | ultra | tti* | harris | dolphin | highlevel | gould \ - | cbm | ns | masscomp | apple | axis | knuth | cray \ - | microblaze* | sim | cisco \ - | oki | wec | wrs | winbond) - basic_machine=$field1-$field2 - os= - ;; - *) - basic_machine=$field1 - os=$field2 - ;; - esac - ;; - esac - ;; - *) - # Convert single-component short-hands not valid as part of - # multi-component configurations. - case $field1 in - 386bsd) - basic_machine=i386-pc - os=bsd - ;; - a29khif) - basic_machine=a29k-amd - os=udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=scout - ;; - alliant) - basic_machine=fx80-alliant - os= - ;; - altos | altos3068) - basic_machine=m68k-altos - os= - ;; - am29k) - basic_machine=a29k-none - os=bsd - ;; - amdahl) - basic_machine=580-amdahl - os=sysv - ;; - amiga) - basic_machine=m68k-unknown - os= - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=bsd - ;; - aros) - basic_machine=i386-pc - os=aros - ;; - aux) - basic_machine=m68k-apple - os=aux - ;; - balance) - basic_machine=ns32k-sequent - os=dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=linux - ;; - cegcc) - basic_machine=arm-unknown - os=cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=bsd - ;; - convex-c2) - basic_machine=c2-convex - os=bsd - ;; - convex-c32) - basic_machine=c32-convex - os=bsd - ;; - convex-c34) - basic_machine=c34-convex - os=bsd - ;; - convex-c38) - basic_machine=c38-convex - os=bsd - ;; - cray) - basic_machine=j90-cray - os=unicos - ;; - crds | unos) - basic_machine=m68k-crds - os= - ;; - da30) - basic_machine=m68k-da30 - os= - ;; - decstation | pmax | pmin | dec3100 | decstatn) - basic_machine=mips-dec - os= - ;; - delta88) - basic_machine=m88k-motorola - os=sysv3 - ;; - dicos) - basic_machine=i686-pc - os=dicos - ;; - djgpp) - basic_machine=i586-pc - os=msdosdjgpp - ;; - ebmon29k) - basic_machine=a29k-amd - os=ebmon - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=ose - ;; - gmicro) - basic_machine=tron-gmicro - os=sysv - ;; - go32) - basic_machine=i386-pc - os=go32 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=hms - ;; - harris) - basic_machine=m88k-harris - os=sysv3 - ;; - hp300 | hp300hpux) - basic_machine=m68k-hp - os=hpux - ;; - hp300bsd) - basic_machine=m68k-hp - os=bsd - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=proelf - ;; - i386mach) - basic_machine=i386-mach - os=mach - ;; - isi68 | isi) - basic_machine=m68k-isi - os=sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=linux - ;; - magnum | m3230) - basic_machine=mips-mips - os=sysv - ;; - merlin) - basic_machine=ns32k-utek - os=sysv - ;; - mingw64) - basic_machine=x86_64-pc - os=mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=mingw32ce - ;; - monitor) - basic_machine=m68k-rom68k - os=coff - ;; - morphos) - basic_machine=powerpc-unknown - os=morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=moxiebox - ;; - msdos) - basic_machine=i386-pc - os=msdos - ;; - msys) - basic_machine=i686-pc - os=msys - ;; - mvs) - basic_machine=i370-ibm - os=mvs - ;; - nacl) - basic_machine=le32-unknown - os=nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=sysv4 - ;; - netbsd386) - basic_machine=i386-pc - os=netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=newsos - ;; - news1000) - basic_machine=m68030-sony - os=newsos - ;; - necv70) - basic_machine=v70-nec - os=sysv - ;; - nh3000) - basic_machine=m68k-harris - os=cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=cxux - ;; - nindy960) - basic_machine=i960-intel - os=nindy - ;; - mon960) - basic_machine=i960-intel - os=mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=nonstopux - ;; - os400) - basic_machine=powerpc-ibm - os=os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=ose - ;; - os68k) - basic_machine=m68k-none - os=os68k - ;; - paragon) - basic_machine=i860-intel - os=osf - ;; - parisc) - basic_machine=hppa-unknown - os=linux - ;; - pw32) - basic_machine=i586-unknown - os=pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=rdos - ;; - rdos32) - basic_machine=i386-pc - os=rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=coff - ;; - sa29200) - basic_machine=a29k-amd - os=udi - ;; - sei) - basic_machine=mips-sei - os=seiux - ;; - sequent) - basic_machine=i386-sequent - os= - ;; - sps7) - basic_machine=m68k-bull - os=sysv2 - ;; - st2000) - basic_machine=m68k-tandem - os= - ;; - stratus) - basic_machine=i860-stratus - os=sysv4 - ;; - sun2) - basic_machine=m68000-sun - os= - ;; - sun2os3) - basic_machine=m68000-sun - os=sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=sunos4 - ;; - sun3) - basic_machine=m68k-sun - os= - ;; - sun3os3) - basic_machine=m68k-sun - os=sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=sunos4 - ;; - sun4) - basic_machine=sparc-sun - os= - ;; - sun4os3) - basic_machine=sparc-sun - os=sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=solaris2 - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - os= - ;; - sv1) - basic_machine=sv1-cray - os=unicos - ;; - symmetry) - basic_machine=i386-sequent - os=dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=unicos - ;; - t90) - basic_machine=t90-cray - os=unicos - ;; - toad1) - basic_machine=pdp10-xkl - os=tops20 - ;; - tpf) - basic_machine=s390x-ibm - os=tpf - ;; - udi29k) - basic_machine=a29k-amd - os=udi - ;; - ultra3) - basic_machine=a29k-nyu - os=sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=none - ;; - vaxv) - basic_machine=vax-dec - os=sysv - ;; - vms) - basic_machine=vax-dec - os=vms - ;; - vsta) - basic_machine=i386-pc - os=vsta - ;; - vxworks960) - basic_machine=i960-wrs - os=vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=vxworks - ;; - xbox) - basic_machine=i686-pc - os=mingw32 - ;; - ymp) - basic_machine=ymp-cray - os=unicos - ;; - *) - basic_machine=$1 - os= - ;; - esac - ;; -esac - -# Decode 1-component or ad-hoc basic machines -case $basic_machine in - # Here we handle the default manufacturer of certain CPU types. It is in - # some cases the only manufacturer, in others, it is the most popular. - w89k) - cpu=hppa1.1 - vendor=winbond - ;; - op50n) - cpu=hppa1.1 - vendor=oki - ;; - op60c) - cpu=hppa1.1 - vendor=oki - ;; - ibm*) - cpu=i370 - vendor=ibm - ;; - orion105) - cpu=clipper - vendor=highlevel - ;; - mac | mpw | mac-mpw) - cpu=m68k - vendor=apple - ;; - pmac | pmac-mpw) - cpu=powerpc - vendor=apple - ;; - - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - cpu=m68000 - vendor=att - ;; - 3b*) - cpu=we32k - vendor=att - ;; - bluegene*) - cpu=powerpc - vendor=ibm - os=cnk - ;; - decsystem10* | dec10*) - cpu=pdp10 - vendor=dec - os=tops10 - ;; - decsystem20* | dec20*) - cpu=pdp10 - vendor=dec - os=tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - cpu=m68k - vendor=motorola - ;; - dpx2*) - cpu=m68k - vendor=bull - os=sysv3 - ;; - encore | umax | mmax) - cpu=ns32k - vendor=encore - ;; - elxsi) - cpu=elxsi - vendor=elxsi - os=${os:-bsd} - ;; - fx2800) - cpu=i860 - vendor=alliant - ;; - genix) - cpu=ns32k - vendor=ns - ;; - h3050r* | hiux*) - cpu=hppa1.1 - vendor=hitachi - os=hiuxwe2 - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - cpu=m68000 - vendor=hp - ;; - hp9k3[2-9][0-9]) - cpu=m68k - vendor=hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - cpu=hppa1.1 - vendor=hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - i*86v32) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=sysv32 - ;; - i*86v4*) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=sysv4 - ;; - i*86v) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=sysv - ;; - i*86sol2) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=solaris2 - ;; - j90 | j90-cray) - cpu=j90 - vendor=cray - os=${os:-unicos} - ;; - iris | iris4d) - cpu=mips - vendor=sgi - case $os in - irix*) - ;; - *) - os=irix4 - ;; - esac - ;; - miniframe) - cpu=m68000 - vendor=convergent - ;; - *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) - cpu=m68k - vendor=atari - os=mint - ;; - news-3600 | risc-news) - cpu=mips - vendor=sony - os=newsos - ;; - next | m*-next) - cpu=m68k - vendor=next - case $os in - openstep*) - ;; - nextstep*) - ;; - ns2*) - os=nextstep2 - ;; - *) - os=nextstep3 - ;; - esac - ;; - np1) - cpu=np1 - vendor=gould - ;; - op50n-* | op60c-*) - cpu=hppa1.1 - vendor=oki - os=proelf - ;; - pa-hitachi) - cpu=hppa1.1 - vendor=hitachi - os=hiuxwe2 - ;; - pbd) - cpu=sparc - vendor=tti - ;; - pbb) - cpu=m68k - vendor=tti - ;; - pc532) - cpu=ns32k - vendor=pc532 - ;; - pn) - cpu=pn - vendor=gould - ;; - power) - cpu=power - vendor=ibm - ;; - ps2) - cpu=i386 - vendor=ibm - ;; - rm[46]00) - cpu=mips - vendor=siemens - ;; - rtpc | rtpc-*) - cpu=romp - vendor=ibm - ;; - sde) - cpu=mipsisa32 - vendor=sde - os=${os:-elf} - ;; - simso-wrs) - cpu=sparclite - vendor=wrs - os=vxworks - ;; - tower | tower-32) - cpu=m68k - vendor=ncr - ;; - vpp*|vx|vx-*) - cpu=f301 - vendor=fujitsu - ;; - w65) - cpu=w65 - vendor=wdc - ;; - w89k-*) - cpu=hppa1.1 - vendor=winbond - os=proelf - ;; - none) - cpu=none - vendor=none - ;; - leon|leon[3-9]) - cpu=sparc - vendor=$basic_machine - ;; - leon-*|leon[3-9]-*) - cpu=sparc - vendor=`echo "$basic_machine" | sed 's/-.*//'` - ;; - - *-*) - # shellcheck disable=SC2162 - IFS="-" read cpu vendor <&2 - exit 1 - ;; - esac - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $vendor in - digital*) - vendor=dec - ;; - commodore*) - vendor=cbm - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x$os != x ] -then -case $os in - # First match some system type aliases that might get confused - # with valid system types. - # solaris* is a basic system type, with this one exception. - auroraux) - os=auroraux - ;; - bluegene*) - os=cnk - ;; - solaris1 | solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - solaris) - os=solaris2 - ;; - unixware*) - os=sysv4.2uw - ;; - gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # es1800 is here to avoid being matched by es* (a different OS) - es1800*) - os=ose - ;; - # Some version numbers need modification - chorusos*) - os=chorusos - ;; - isc) - os=isc2.2 - ;; - sco6) - os=sco5v6 - ;; - sco5) - os=sco3.2v5 - ;; - sco4) - os=sco3.2v4 - ;; - sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - ;; - sco3.2v[4-9]* | sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - ;; - scout) - # Don't match below - ;; - sco*) - os=sco3.2v2 - ;; - psos*) - os=psos - ;; - # Now accept the basic system types. - # The portable systems comes first. - # Each alternative MUST end in a * to match a version number. - # sysv* is not here because it comes later, after sysvr4. - gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ - | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ - | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ - | sym* | kopensolaris* | plan9* \ - | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ - | aos* | aros* | cloudabi* | sortix* | twizzler* \ - | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ - | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ - | knetbsd* | mirbsd* | netbsd* \ - | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ - | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ - | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ - | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ - | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ - | chorusrdb* | cegcc* | glidix* \ - | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ - | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ - | linux-newlib* | linux-musl* | linux-uclibc* \ - | uxpv* | beos* | mpeix* | udk* | moxiebox* \ - | interix* | uwin* | mks* | rhapsody* | darwin* \ - | openstep* | oskit* | conix* | pw32* | nonstopux* \ - | storm-chaos* | tops10* | tenex* | tops20* | its* \ - | os2* | vos* | palmos* | uclinux* | nucleus* \ - | morphos* | superux* | rtmk* | windiss* \ - | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ - | skyos* | haiku* | rdos* | toppers* | drops* | es* \ - | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ - | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ - | nsk* | powerunix) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - qnx*) - case $cpu in - x86 | i*86) - ;; - *) - os=nto-$os - ;; - esac - ;; - hiux*) - os=hiuxwe2 - ;; - nto-qnx*) - ;; - nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - sim | xray | os68k* | v88r* \ - | windows* | osx | abug | netware* | os9* \ - | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) - ;; - linux-dietlibc) - os=linux-dietlibc - ;; - linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - lynx*178) - os=lynxos178 - ;; - lynx*5) - os=lynxos5 - ;; - lynx*) - os=lynxos - ;; - mac*) - os=`echo "$os" | sed -e 's|mac|macos|'` - ;; - opened*) - os=openedition - ;; - os400*) - os=os400 - ;; - sunos5*) - os=`echo "$os" | sed -e 's|sunos5|solaris2|'` - ;; - sunos6*) - os=`echo "$os" | sed -e 's|sunos6|solaris3|'` - ;; - wince*) - os=wince - ;; - utek*) - os=bsd - ;; - dynix*) - os=bsd - ;; - acis*) - os=aos - ;; - atheos*) - os=atheos - ;; - syllable*) - os=syllable - ;; - 386bsd) - os=bsd - ;; - ctix* | uts*) - os=sysv - ;; - nova*) - os=rtmk-nova - ;; - ns2) - os=nextstep2 - ;; - # Preserve the version number of sinix5. - sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - sinix*) - os=sysv4 - ;; - tpf*) - os=tpf - ;; - triton*) - os=sysv3 - ;; - oss*) - os=sysv3 - ;; - svr4*) - os=sysv4 - ;; - svr3) - os=sysv3 - ;; - sysvr4) - os=sysv4 - ;; - # This must come after sysvr4. - sysv*) - ;; - ose*) - os=ose - ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) - os=mint - ;; - zvmoe) - os=zvmoe - ;; - dicos*) - os=dicos - ;; - pikeos*) - # Until real need of OS specific support for - # particular features comes up, bare metal - # configurations are quite functional. - case $cpu in - arm*) - os=eabi - ;; - *) - os=elf - ;; - esac - ;; - nacl*) - ;; - ios) - ;; - none) - ;; - *-eabi) - ;; - *) - echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $cpu-$vendor in - score-*) - os=elf - ;; - spu-*) - os=elf - ;; - *-acorn) - os=riscix1.2 - ;; - arm*-rebel) - os=linux - ;; - arm*-semi) - os=aout - ;; - c4x-* | tic4x-*) - os=coff - ;; - c8051-*) - os=elf - ;; - clipper-intergraph) - os=clix - ;; - hexagon-*) - os=elf - ;; - tic54x-*) - os=coff - ;; - tic55x-*) - os=coff - ;; - tic6x-*) - os=coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=tops20 - ;; - pdp11-*) - os=none - ;; - *-dec | vax-*) - os=ultrix4.2 - ;; - m68*-apollo) - os=domain - ;; - i386-sun) - os=sunos4.0.2 - ;; - m68000-sun) - os=sunos3 - ;; - m68*-cisco) - os=aout - ;; - mep-*) - os=elf - ;; - mips*-cisco) - os=elf - ;; - mips*-*) - os=elf - ;; - or32-*) - os=coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=sysv3 - ;; - sparc-* | *-sun) - os=sunos4.1.1 - ;; - pru-*) - os=elf - ;; - *-be) - os=beos - ;; - *-ibm) - os=aix - ;; - *-knuth) - os=mmixware - ;; - *-wec) - os=proelf - ;; - *-winbond) - os=proelf - ;; - *-oki) - os=proelf - ;; - *-hp) - os=hpux - ;; - *-hitachi) - os=hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=sysv - ;; - *-cbm) - os=amigaos - ;; - *-dg) - os=dgux - ;; - *-dolphin) - os=sysv3 - ;; - m68k-ccur) - os=rtu - ;; - m88k-omron*) - os=luna - ;; - *-next) - os=nextstep - ;; - *-sequent) - os=ptx - ;; - *-crds) - os=unos - ;; - *-ns) - os=genix - ;; - i370-*) - os=mvs - ;; - *-gould) - os=sysv - ;; - *-highlevel) - os=bsd - ;; - *-encore) - os=bsd - ;; - *-sgi) - os=irix - ;; - *-siemens) - os=sysv4 - ;; - *-masscomp) - os=rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=uxpv - ;; - *-rom68k) - os=coff - ;; - *-*bug) - os=coff - ;; - *-apple) - os=macos - ;; - *-atari*) - os=mint - ;; - *-wrs) - os=vxworks - ;; - *) - os=none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -case $vendor in - unknown) - case $os in - riscix*) - vendor=acorn - ;; - sunos*) - vendor=sun - ;; - cnk*|-aix*) - vendor=ibm - ;; - beos*) - vendor=be - ;; - hpux*) - vendor=hp - ;; - mpeix*) - vendor=hp - ;; - hiux*) - vendor=hitachi - ;; - unos*) - vendor=crds - ;; - dgux*) - vendor=dg - ;; - luna*) - vendor=omron - ;; - genix*) - vendor=ns - ;; - clix*) - vendor=intergraph - ;; - mvs* | opened*) - vendor=ibm - ;; - os400*) - vendor=ibm - ;; - ptx*) - vendor=sequent - ;; - tpf*) - vendor=ibm - ;; - vxsim* | vxworks* | windiss*) - vendor=wrs - ;; - aux*) - vendor=apple - ;; - hms*) - vendor=hitachi - ;; - mpw* | macos*) - vendor=apple - ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) - vendor=atari - ;; - vos*) - vendor=stratus - ;; - esac - ;; -esac - -echo "$cpu-$vendor-$os" -exit - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/M2/config/install-sh b/M2/config/install-sh deleted file mode 100755 index e9de23842dc..00000000000 --- a/M2/config/install-sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/M2/configure.ac b/M2/configure.ac index ac8357cb614..191eb956006 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -154,8 +154,6 @@ AC_MSG_NOTICE([operating system information: OS = $OS ISSUE = $ISSUE]) -AC_CONFIG_AUX_DIR(config) - AC_CHECK_PROGS(MAKE,gmake make,false) AC_CHECK_PROGS(PKG_CONFIG,pkg-config,false) if test $PKG_CONFIG = false; then AC_MSG_ERROR(pkg-config is required); fi From bfb2ea4da55024a5c24cdee2bfac9cfb45578cdb Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 15 Oct 2024 08:27:27 -0400 Subject: [PATCH 063/226] Remove unused config.Microsoft --- M2/config/config.Microsoft | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 M2/config/config.Microsoft diff --git a/M2/config/config.Microsoft b/M2/config/config.Microsoft deleted file mode 100644 index 000757d0375..00000000000 --- a/M2/config/config.Microsoft +++ /dev/null @@ -1,37 +0,0 @@ -# -*- Mode: Makefile -*- - -# Makefile options needed for Microsoft C compiler, 'cl' - -OUTPUT_OPTION = -Fo$@ - -AR = lib -ARFLAGS = -MACHINE:i386 -nologo -verbose -(%): %; $(AR) $(ARFLAGS) /out:$@ $@ $< - -RANLIB = true - -CFLAGS = -Zi -nologo -G5 -W3 -GR -GX -CXXFLAGS = -Zi -nologo -G5 -W3 -GR -GX -# LDFLAGS = -Zi - -ifeq "$(OPTIMIZE)" "yes" -CFLAGS = -O3 $(CFLAGS) -CXXFLAGS = -O3 $(CXXFLAGS) -endif - -LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) -%: %.c; $(LINK.c) $^ $(LOADLIBES) -link $(LDLIBS) -out:$@.exe - -LINK.o = $(CC) $(LDFLAGS) $(TARGET_ARCH) -%: %.o; $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION) - -LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) -%: %.cc; $(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION) - -COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -%.o: %.c; $(COMPILE.c) $< $(OUTPUT_OPTION) - -COMPILE.cc = $(CXX) -TP $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -%.o: %.cc; $(COMPILE.cc) $< $(OUTPUT_OPTION) -%.o: %.cpp; $(COMPILE.cc) $< $(OUTPUT_OPTION) - From 6fa10eae3492b0db1f8696b699495abd2bf5c25c Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 15 Oct 2024 08:31:41 -0400 Subject: [PATCH 064/226] Rename config subdirectory -> m4 "config" is ambiguous (what are we configuring?). "m4" is a very standard directory name in autotools projects --- M2/Makefile.in | 8 ++++---- M2/configure.ac | 21 ++++++++++---------- M2/libraries/Makefile.template | 2 +- M2/libraries/lrslib/Makefile.in | 2 +- M2/{config => m4}/ax_boost_base.m4 | 0 M2/{config => m4}/ax_boost_regex.m4 | 0 M2/{config => m4}/ax_compare_version.m4 | 0 M2/{config => m4}/ax_func_accept_argtypes.m4 | 0 M2/{config => m4}/ax_prog_cc_for_build.m4 | 0 M2/{config => m4}/files | 0 M2/{config => m4}/gtest.m4 | 0 M2/{config => m4}/openmp.m4 | 0 M2/{config => m4}/relpaths.m4 | 0 M2/{config => m4}/search-libraries.m4 | 0 14 files changed, 16 insertions(+), 17 deletions(-) rename M2/{config => m4}/ax_boost_base.m4 (100%) rename M2/{config => m4}/ax_boost_regex.m4 (100%) rename M2/{config => m4}/ax_compare_version.m4 (100%) rename M2/{config => m4}/ax_func_accept_argtypes.m4 (100%) rename M2/{config => m4}/ax_prog_cc_for_build.m4 (100%) rename M2/{config => m4}/files (100%) rename M2/{config => m4}/gtest.m4 (100%) rename M2/{config => m4}/openmp.m4 (100%) rename M2/{config => m4}/relpaths.m4 (100%) rename M2/{config => m4}/search-libraries.m4 (100%) diff --git a/M2/Makefile.in b/M2/Makefile.in index 132309538bf..6b619633b13 100644 --- a/M2/Makefile.in +++ b/M2/Makefile.in @@ -67,7 +67,7 @@ clean: if [ -f Makefile ] ; then $(MAKE) -f Makefile clean-tools ; fi install: configured; $(MAKE) -C distributions $@ -@srcdir@/configure : @srcdir@/configure.ac @srcdir@/config/files; $(MAKE) -C @srcdir@ -f Makefile +@srcdir@/configure : @srcdir@/configure.ac @srcdir@/m4/files; $(MAKE) -C @srcdir@ -f Makefile recheck config.status: @srcdir@/configure @srcdir@/Macaulay2/packages/=distributed-packages $(WHY) ./config.status --recheck @@ -105,13 +105,13 @@ srcdir: subst: config.status ; ./config.status show: config.status <$< sed -e 's/\\\n//' |egrep '^[SD]\["' | sed -e 's/^S."\(.*\)"\]="\(.*\)"$$/\1=\2/' -e 's/^D."\(.*\)"\]="\(.*\)"$$/#define \1 \2/' -e 's/\\"/"/g' -CONFIG_FILES = @srcdir@/configure @srcdir@/install-sh @srcdir@/config.sub @srcdir@/config.guess @srcdir@/config/files +CONFIG_FILES = @srcdir@/configure @srcdir@/install-sh @srcdir@/config.sub @srcdir@/config.guess @srcdir@/m4/files reconfigure-top-only: recheck check-for-undefined-configure-variables protect-configs protect-configs: - @ chmod a-w $(shell cat @srcdir@/config/files) + @ chmod a-w $(shell cat @srcdir@/m4/files) check-for-undefined-configure-variables: : "checking for strings that look like undefined configure variables in all *.in files..." - @ if egrep -nH '@[A-Za-z_]+@' $(shell cat @srcdir@/config/files) | sed -e 's=^\([^:]*\):=@srcdir@/\1.in:=' | egrep . ; \ + @ if egrep -nH '@[A-Za-z_]+@' $(shell cat @srcdir@/m4/files) | sed -e 's=^\([^:]*\):=@srcdir@/\1.in:=' | egrep . ; \ then exit 1; \ fi configure-help: $(CONFIG_FILES) ; @ @srcdir@/configure --help diff --git a/M2/configure.ac b/M2/configure.ac index 191eb956006..d7ec44d6002 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -2,7 +2,7 @@ AC_INIT([Macaulay2],[m4_esyscmd_s([cat VERSION])],[https://github.com/Macaulay2/ AC_MSG_NOTICE([configuring Macaulay2 version $PACKAGE_VERSION]) AC_CONFIG_SRCDIR([VERSION]) AC_CONFIG_HEADERS(include/M2/config.h) -AC_CONFIG_FILES(m4_include(config/files)) +AC_CONFIG_FILES(m4_include(m4/files)) AC_SUBST(CONFIGURED_FILES,"$ac_config_files") AC_SUBST(CONFIG_ARGS,"$ac_configure_args") echo "'$0' $ac_configure_args" > config.args @@ -10,16 +10,15 @@ C_CONFIG_ARGS=` echo "$ac_configure_args" | sed -e 's=\\\\=\\\\\\\\=g' -e 's=\\" AC_DEFINE_UNQUOTED(CONFIG_ARGS,"$C_CONFIG_ARGS",arguments used for configure) AC_SUBST(CONFIG_CMD,"'$0' $ac_configure_args") -AC_CONFIG_MACRO_DIR([config]) dnl can't get this to work -m4_include(config/ax_compare_version.m4) -m4_include(config/ax_prog_cc_for_build.m4) -m4_include(config/ax_func_accept_argtypes.m4) -m4_include(config/relpaths.m4) -m4_include(config/gtest.m4) -m4_include(config/openmp.m4) -m4_include(config/search-libraries.m4) -m4_include(config/ax_boost_base.m4) -m4_include(config/ax_boost_regex.m4) +m4_include(m4/ax_compare_version.m4) +m4_include(m4/ax_prog_cc_for_build.m4) +m4_include(m4/ax_func_accept_argtypes.m4) +m4_include(m4/relpaths.m4) +m4_include(m4/gtest.m4) +m4_include(m4/openmp.m4) +m4_include(m4/search-libraries.m4) +m4_include(m4/ax_boost_base.m4) +m4_include(m4/ax_boost_regex.m4) dnl define(TO_UPPER,[translit($1, [a-z], [A-Z])]) diff --git a/M2/libraries/Makefile.template b/M2/libraries/Makefile.template index bc0d2b076a6..c9023fa08c0 100644 --- a/M2/libraries/Makefile.template +++ b/M2/libraries/Makefile.template @@ -1,6 +1,6 @@ # replace FOO by the name of the library or package # install this file as FOO/Makefile.in -# add libraries/FOO/Makefile to ../config/files +# add libraries/FOO/Makefile to ../m4/files # run make -C ../.. # reconfigure in the build directory HOMEPAGE = diff --git a/M2/libraries/lrslib/Makefile.in b/M2/libraries/lrslib/Makefile.in index 3094fabc759..622743d55c0 100644 --- a/M2/libraries/lrslib/Makefile.in +++ b/M2/libraries/lrslib/Makefile.in @@ -1,6 +1,6 @@ # replace lrslib by the name of the library or package # install this file as lrslib/Makefile.in -# add libraries/lrslib/Makefile to ../config/files +# add libraries/lrslib/Makefile to ../m4/files # run make -C ../.. # reconfigure in the build directory HOMEPAGE = http://www-cgrl.cs.mcgill.ca/~avis/C/lrs.html diff --git a/M2/config/ax_boost_base.m4 b/M2/m4/ax_boost_base.m4 similarity index 100% rename from M2/config/ax_boost_base.m4 rename to M2/m4/ax_boost_base.m4 diff --git a/M2/config/ax_boost_regex.m4 b/M2/m4/ax_boost_regex.m4 similarity index 100% rename from M2/config/ax_boost_regex.m4 rename to M2/m4/ax_boost_regex.m4 diff --git a/M2/config/ax_compare_version.m4 b/M2/m4/ax_compare_version.m4 similarity index 100% rename from M2/config/ax_compare_version.m4 rename to M2/m4/ax_compare_version.m4 diff --git a/M2/config/ax_func_accept_argtypes.m4 b/M2/m4/ax_func_accept_argtypes.m4 similarity index 100% rename from M2/config/ax_func_accept_argtypes.m4 rename to M2/m4/ax_func_accept_argtypes.m4 diff --git a/M2/config/ax_prog_cc_for_build.m4 b/M2/m4/ax_prog_cc_for_build.m4 similarity index 100% rename from M2/config/ax_prog_cc_for_build.m4 rename to M2/m4/ax_prog_cc_for_build.m4 diff --git a/M2/config/files b/M2/m4/files similarity index 100% rename from M2/config/files rename to M2/m4/files diff --git a/M2/config/gtest.m4 b/M2/m4/gtest.m4 similarity index 100% rename from M2/config/gtest.m4 rename to M2/m4/gtest.m4 diff --git a/M2/config/openmp.m4 b/M2/m4/openmp.m4 similarity index 100% rename from M2/config/openmp.m4 rename to M2/m4/openmp.m4 diff --git a/M2/config/relpaths.m4 b/M2/m4/relpaths.m4 similarity index 100% rename from M2/config/relpaths.m4 rename to M2/m4/relpaths.m4 diff --git a/M2/config/search-libraries.m4 b/M2/m4/search-libraries.m4 similarity index 100% rename from M2/config/search-libraries.m4 rename to M2/m4/search-libraries.m4 From 4e8357abbfb3bab01b1c557cba50daaad2a2682a Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 16 Oct 2024 10:42:41 -0400 Subject: [PATCH 065/226] Move Emacs backup files to top-level .gitignore This way, we'll also ignore them in bugs, .github, etc. [ci skip] --- .gitignore | 3 +-- M2/.gitignore | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 99830c32324..d300683d678 100644 --- a/.gitignore +++ b/.gitignore @@ -6,13 +6,12 @@ /M2/autom4te.cache /M2/configure /M2/include/M2/config.h.in -/M2/include/M2/config.h.in~ /M2/include/M2/config.h /M2/include/M2/config.h.in.stamp /M2/.idea /M2/tmp /builds +*~ .DS_Store .#* .*.swp - diff --git a/M2/.gitignore b/M2/.gitignore index d4646a1cf2a..7148daeb3c0 100644 --- a/M2/.gitignore +++ b/M2/.gitignore @@ -1,4 +1,3 @@ -*~ /M2 /config.args /config.log From bbc9f099484946762ef4f667a860be286665a891 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Wed, 16 Oct 2024 05:04:54 +0200 Subject: [PATCH 066/226] fixed a hash-dependent SumsOfSquares test --- M2/Macaulay2/packages/SumsOfSquares.m2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/M2/Macaulay2/packages/SumsOfSquares.m2 b/M2/Macaulay2/packages/SumsOfSquares.m2 index ddaea2d413d..af643b30f5e 100644 --- a/M2/Macaulay2/packages/SumsOfSquares.m2 +++ b/M2/Macaulay2/packages/SumsOfSquares.m2 @@ -474,12 +474,12 @@ createSOSModel(Matrix,Matrix) := o -> (F,v) -> ( -- monomials in vvT vvT := entries(v* transpose v); - mons := g -> set first entries monomials g; - K1 := toList \\ sum \\ mons \ flatten vvT; + mons := g -> unique first entries monomials g; + K1 := unique \\ flatten \\ mons \ flatten vvT; -- monomials in F and not in vvT - lmf := sum \\ mons \ flatten entries F; - K2 := toList(lmf - K1); + lmf := unique \\ flatten \\ mons \ flatten entries F; + K2 := lmf - set K1; K := K1 | K2; -- Linear constraints: b From fa3eca0f067200ad0fec77b32f2f00c75dc8f1b8 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 6 Sep 2024 16:53:52 -0400 Subject: [PATCH 067/226] Simplify call to flint's configure script (autotools) It no longer supports the LIB_DIRS variable but it does support CPPFLAGS and LDFLAGS, so there's no reason to define our own CONFIGURECMD variable. Instead, we can use the default one and just define PRECONFIGURE and add a couple things CONFIGOPTIONS. [ci skip] --- M2/libraries/flint/Makefile.in | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/M2/libraries/flint/Makefile.in b/M2/libraries/flint/Makefile.in index 51a0c2b322d..79cb1190f38 100644 --- a/M2/libraries/flint/Makefile.in +++ b/M2/libraries/flint/Makefile.in @@ -15,12 +15,9 @@ CONFIGOPTIONS += --enable-assert CFLAGS += -O0 -fno-unroll-loops endif CFLAGS += -std=c90 -pedantic-errors -# the flint configure script does not accept CPPFLAGS -# CONFIGURECMD = LIB_DIRS=$(LIBRARIESDIR)/lib ./configure --with-gc --with-blas --disable-tls -CONFIGURECMD = ./bootstrap.sh && \ - LIB_DIRS=$(LIBRARIESDIR)/lib ./configure --without-blas \ - --prefix='$(PREFIX)' --disable-shared CC='$(CC)' \ - CFLAGS='$(CFLAGS) $(CPPFLAGS)' + +PRECONFIGURE = ./bootstrap.sh +CONFIGOPTIONS += --without-blas --disable-shared ifneq ($(VERBOSE),) BUILDOPTIONS += AT= QUIET_CC= QUIET_CXX= QUIET_AR= From 7618b126140c1d048dffd67bf1e3ea253b7374a9 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 18 Sep 2024 21:14:40 -0400 Subject: [PATCH 068/226] Sort library names in M2/config/files --- M2/m4/files | 56 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/M2/m4/files b/M2/m4/files index 49591730ddf..2918fdb801e 100644 --- a/M2/m4/files +++ b/M2/m4/files @@ -26,44 +26,44 @@ distributions/deb/macaulay2/postinst distributions/deb/macaulay2/prerm distributions/deb/macaulay2/preinst libraries/Makefile -libraries/cohomcalg/Makefile -libraries/topcom/Makefile -libraries/Makefile.library +libraries/4ti2/Makefile libraries/M2/Makefile +libraries/Makefile.library +libraries/cddlib/Makefile +libraries/cddplus/Makefile +libraries/cohomcalg/Makefile +libraries/csdp/Makefile +libraries/factory/Makefile +libraries/fflas_ffpack/Makefile +libraries/flint/Makefile +libraries/fplll/Makefile +libraries/frobby/Makefile libraries/gc/Makefile libraries/gdbm/Makefile -libraries/flint/Makefile +libraries/gfan/Makefile +libraries/gftables/Makefile +libraries/givaro/Makefile +libraries/glpk/Makefile libraries/gmp/Makefile -libraries/mpfr/Makefile -libraries/mpfi/Makefile -libraries/memtailor/Makefile +libraries/gtest/Makefile +libraries/lapack/Makefile +libraries/libtool/Makefile +libraries/linbox/Makefile +libraries/lrslib/Makefile libraries/mathic/Makefile libraries/mathicgb/Makefile -libraries/gtest/Makefile -libraries/4ti2/Makefile -libraries/gfan/Makefile -libraries/fflas_ffpack/Makefile +libraries/memtailor/Makefile +libraries/mpfi/Makefile +libraries/mpfr/Makefile +libraries/mpsolve/Makefile +libraries/msolve/Makefile libraries/nauty/Makefile -libraries/cddplus/Makefile -libraries/lrslib/Makefile -libraries/cddlib/Makefile -libraries/glpk/Makefile -libraries/linbox/Makefile -libraries/givaro/Makefile -libraries/fplll/Makefile -libraries/polymake/Makefile libraries/normaliz/Makefile -libraries/csdp/Makefile +libraries/ntl/Makefile libraries/pari/Makefile +libraries/polymake/Makefile libraries/readline/Makefile -libraries/ntl/Makefile -libraries/libtool/Makefile -libraries/gftables/Makefile -libraries/factory/Makefile -libraries/mpsolve/Makefile -libraries/msolve/Makefile -libraries/frobby/Makefile -libraries/lapack/Makefile +libraries/topcom/Makefile Macaulay2/Makefile Macaulay2/README Macaulay2/packages/SCSCP/docinput/Makefile From 7fd70ef8f169b791c88b96c5ba9fd0cc3a05508a Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 18 Sep 2024 22:01:13 -0400 Subject: [PATCH 069/226] Add Makefile for building (well, copying) eigen (autotools) --- M2/libraries/eigen/Makefile.in | 15 +++++++++++++++ M2/m4/files | 1 + 2 files changed, 16 insertions(+) create mode 100644 M2/libraries/eigen/Makefile.in diff --git a/M2/libraries/eigen/Makefile.in b/M2/libraries/eigen/Makefile.in new file mode 100644 index 00000000000..7e6ca69d28b --- /dev/null +++ b/M2/libraries/eigen/Makefile.in @@ -0,0 +1,15 @@ +HOMEPAGE = https://eigen.tuxfamily.org/ +VERSION = 3.4.0 +URL = https://gitlab.com/libeigen/eigen/-/archive/$(VERSION) +TARFILE = eigen-$(VERSION).tar.gz +LICENSEFILES = COPYING.* README.md + +CONFIGURECMD = true +BUILDCMD = true +INSTALLCMD = $(MKDIR_P) $(LIBRARIESDIR)/include && \ + cp -r Eigen $(LIBRARIESDIR)/include && \ + $(MKDIR_P) $(LIBRARIESDIR)/include/unsupported && \ + cp -r unsupported/Eigen $(LIBRARIESDIR)/include/unsupported + +include ../Makefile.library +Makefile: @srcdir@/Makefile.in ; cd ../.. && ./config.status libraries/eigen/Makefile diff --git a/M2/m4/files b/M2/m4/files index 2918fdb801e..610d7c74ddd 100644 --- a/M2/m4/files +++ b/M2/m4/files @@ -33,6 +33,7 @@ libraries/cddlib/Makefile libraries/cddplus/Makefile libraries/cohomcalg/Makefile libraries/csdp/Makefile +libraries/eigen/Makefile libraries/factory/Makefile libraries/fflas_ffpack/Makefile libraries/flint/Makefile From 71265e77bf1bed6183a0a8a146efeacfc41edd71 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 18 Sep 2024 22:39:48 -0400 Subject: [PATCH 070/226] Update check for eigen (autotools) We're now able to build eigen if it doesn't exist or if we pass the --enable-build-libraries option. We also don't require pkg-config support, but still use it to find the location of the headers (which we'll need on Debian systems where they're install in /usr/include/eigen3). --- M2/configure.ac | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/M2/configure.ac b/M2/configure.ac index d7ec44d6002..3b23dedd06c 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -652,7 +652,7 @@ AC_SUBST(BUILTLIBS) # (Programs linked by this configure script are linked with the options in LIBS. This allows libraries # dependent on previously detected libraries to be detected by tests that involve linking. -AC_SUBST(LIBLIST, " gc gdbm gmp mpfr mpfi normaliz readline ntl flint factory lapack mpsolve frobby glpk cddlib fplll givaro fflas_ffpack linbox gtest memtailor mathic mathicgb ") +AC_SUBST(LIBLIST, " gc gdbm gmp mpfr mpfi normaliz readline ntl flint factory lapack mpsolve frobby glpk cddlib fplll givaro fflas_ffpack linbox gtest memtailor mathic mathicgb eigen ") # The list LIBLIST is the list of libraries that might be used and linked into M2. AC_SUBST(PROGLIST, "4ti2 gfan csdp nauty cddplus lrslib gftables topcom cohomcalg msolve") @@ -1132,15 +1132,18 @@ found and $msolve_min_version is required; will build]) [AC_MSG_RESULT([no, will build]) BUILD_msolve=yes])]) -AC_MSG_CHECKING([whether eigen3 library is installed]) -if $PKG_CONFIG --exists eigen3 -then CFO=`$PKG_CONFIG --cflags-only-other eigen3` - CFI=`$PKG_CONFIG --cflags-only-I eigen3` - CXXFLAGS="$CXXFLAGS $CFO" - CPPFLAGS="$CPPFLAGS $CFI" - AC_MSG_RESULT([yes, with flags $CFI $CFO]) -else AC_MSG_ERROR(eigen library not found) -fi +AS_IF([test $BUILD_eigen = no], + [AC_MSG_CHECKING([whether pkg-config provides flags for eigen]) + AS_IF([$PKG_CONFIG --exists eigen3], + [CFO=`$PKG_CONFIG --cflags-only-other eigen3` + CFI=`$PKG_CONFIG --cflags-only-I eigen3` + CXXFLAGS="$CXXFLAGS $CFO" + CPPFLAGS="$CPPFLAGS $CFI" + AC_MSG_RESULT([yes, $CFI $CFO])], + [AC_MSG_RESULT([no])]) + AC_CHECK_HEADER([Eigen/SVD],, + [AC_MSG_NOTICE([eigen is not installed; will build]) + BUILD_eigen=yes])]) AC_LANG(C++) AC_CHECK_HEADER(NTL/version.h,,BUILD_ntl=yes) From b77a42cf8f3c5b9485283a994bc5600f637636fe Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 25 Sep 2024 11:40:23 -0400 Subject: [PATCH 071/226] Give more useful error message when "cmp" isn't found --- M2/configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/M2/configure.ac b/M2/configure.ac index 3b23dedd06c..12d3ef2489d 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -172,7 +172,8 @@ AS_IF([test $PATCH = false], AC_MSG_ERROR([patch is required])) AC_CHECK_PROGS(WHICH,which,false) dnl used by 4ti2 AS_IF([test $WHICH = false], AC_MSG_ERROR([which is required])) AC_CHECK_PROGS(CMP,cmp,false) -AS_IF([test $CMP = false], AC_MSG_ERROR([cmp is required])) +AS_IF([test $CMP = false], + AC_MSG_ERROR([cmp is required (try installing 'diffutils' package)])) AC_CHECK_TOOL(AR,ar,false) AC_CHECK_TOOL(AS,as,false) From 3cfa021becad740c4ab033b081d13a34c29da037 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 10:28:51 -0400 Subject: [PATCH 072/226] Disable tbb in mathicgb build if disabled for M2 build (autotools) --- M2/libraries/mathicgb/Makefile.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/M2/libraries/mathicgb/Makefile.in b/M2/libraries/mathicgb/Makefile.in index 984dc58fe63..61d84c518c2 100644 --- a/M2/libraries/mathicgb/Makefile.in +++ b/M2/libraries/mathicgb/Makefile.in @@ -5,6 +5,9 @@ VERSION = 20240205-4cd2bd1357 # PATCHFILE = @abs_srcdir@/patch-$(VERSION) PRECONFIGURE = autoreconf -i CONFIGOPTIONS = --disable-shared PKG_CONFIG_PATH=$(LIBRARIESDIR)/lib/pkgconfig GTEST_PATH=@GTEST_PATH@ --with-gtest=yes +ifeq (@ENABLE_TBB@, no) +CONFIGOPTIONS += --without-tbb +endif include ../Makefile.library Makefile: @srcdir@/Makefile.in ; cd ../.. && ./config.status libraries/mathicgb/Makefile # Local Variables: From b7a14d99b4ffa9c5ed39125c1e105e6b725374c6 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 11:44:27 -0400 Subject: [PATCH 073/226] Add -lpthread to msolve configure script to detect flint --- M2/libraries/msolve/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/M2/libraries/msolve/Makefile.in b/M2/libraries/msolve/Makefile.in index 6ee49aa5aa3..fc0a6aa2654 100644 --- a/M2/libraries/msolve/Makefile.in +++ b/M2/libraries/msolve/Makefile.in @@ -6,6 +6,8 @@ LICENSEFILES = README.md COPYING PRECONFIGURE = ./autogen.sh +CONFIGOPTIONS += LIBS=-lpthread # needed to detect flint + VLIMIT = 1500000 include ../Makefile.library From d4b253fe023c0673fc5bf5ef35dbafb6d738d0f8 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 11:52:38 -0400 Subject: [PATCH 074/226] Built msolve as static library (autotools) Needed since it links against flint, which we build as a static library. --- M2/libraries/msolve/Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/M2/libraries/msolve/Makefile.in b/M2/libraries/msolve/Makefile.in index fc0a6aa2654..d1ed682fc5d 100644 --- a/M2/libraries/msolve/Makefile.in +++ b/M2/libraries/msolve/Makefile.in @@ -6,7 +6,9 @@ LICENSEFILES = README.md COPYING PRECONFIGURE = ./autogen.sh -CONFIGOPTIONS += LIBS=-lpthread # needed to detect flint +# need to link against libpthread for configure script to find flint +# need to build as a static library since we build flint as a static library +CONFIGOPTIONS += LIBS=-lpthread --disable-shared VLIMIT = 1500000 From 1473dbb33b613d5939b5b861181d21d1e0736c73 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 13:34:46 -0400 Subject: [PATCH 075/226] Define MATHICGB_NO_TBB when building w/o TBB support --- M2/Macaulay2/e/m2tbb.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/M2/Macaulay2/e/m2tbb.hpp b/M2/Macaulay2/e/m2tbb.hpp index bcabcebb091..1d65ea4323b 100644 --- a/M2/Macaulay2/e/m2tbb.hpp +++ b/M2/Macaulay2/e/m2tbb.hpp @@ -4,6 +4,11 @@ // The plan: All uses of TBB go through the following interface. #include // make sure WITH_TBB is set before including mtbb.hpp + +#ifndef WITH_TBB +#define MATHICGB_NO_TBB 1 +#endif + #include "mathicgb/mtbb.hpp" #endif From 0f185083860f7ff71b52a15eab95cce6a123cf95 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 14:29:11 -0400 Subject: [PATCH 076/226] Check that TBB is at least version 2020 (autotools) --- M2/configure.ac | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/M2/configure.ac b/M2/configure.ac index 12d3ef2489d..621f4939e98 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -367,26 +367,32 @@ AC_SEARCH_LIBS(hstrerror,resolv) AC_SEARCH_LIBS(dlopen,dl) AC_SEARCH_LIBS(gethostbyname,nsl) -AC_SUBST(ENABLE_TBB,yes) AC_ARG_ENABLE(tbb, AS_HELP_STRING(--disable-tbb,disable use of the tbb (threaded building blocks) library), ENABLE_TBB=$enableval) -if test $ENABLE_TBB = yes -then AC_DEFINE(WITH_TBB,1,[whether the tbb library has been enabled by the builder]) - AC_SUBST(LIBTBB) dnl LIBTBB is usually set to -ltbb - AC_LANG(C++) - AC_CHECK_HEADER(tbb/tbb.h, - [AC_SEARCH_LIBS(TBB_runtime_interface_version,"tbb", - LIBTBB=$ac_cv_search_TBB_runtime_interface_version, - [AC_MSG_ERROR([tbb library not found])])], - [AC_MSG_ERROR([tbb include file (tbb.h) not found])]) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - #define TBB_SUPPRESS_DEPRECATED_MESSAGES 1 - #include - int main () { - printf("tbb version %d.%d found\n", TBB_VERSION_MAJOR, TBB_VERSION_MINOR); - return 0; - } - ]])]) -fi +AC_SUBST([ENABLE_TBB], [yes]) +AC_ARG_ENABLE([tbb], + [AS_HELP_STRING([--disable-tbb], + [disable use of the tbb (threaded building blocks) library])], + [ENABLE_TBB=$enableval]) +AS_IF([test $ENABLE_TBB = yes], + [AC_DEFINE([WITH_TBB], [1], + [whether the tbb library has been enabled by the builder]) + AC_LANG([C++]) + AC_CHECK_HEADER([tbb/tbb.h],, + [AC_MSG_ERROR([tbb include file (tbb.h) not found])]) + AC_SEARCH_LIBS([TBB_runtime_interface_version], [tbb],, + [AC_MSG_ERROR([tbb library not found])]) + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([ + #include + #define TBB_SUPPRESS_DEPRECATED_MESSAGES 1 + #include + ], [ + std::cout << "checking for TBB version... " << TBB_VERSION_MAJOR << + "." << TBB_VERSION_MINOR << std::endl; + if (TBB_VERSION_MAJOR < 2020) + return 1; + else + return 0;])],, + [AC_MSG_ERROR([TBB >= 2020 required])])]) AC_CHECK_FUNCS([herror error clock_gettime getaddrinfo hstrerror sync getpgrp setpgid fchmod pipe waitpid setrlimit alarm fork sigprocmask kill longjmp siglongjmp sigaction wait4 readlink lstat realpath mkdir link symlink socket accept fcntl personality ioctl]) From a2a3de99ae620dc1d81754b350276e21cefe231d Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 15:22:18 -0400 Subject: [PATCH 077/226] Build mpfr if version < 4 (autotools) --- M2/configure.ac | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/M2/configure.ac b/M2/configure.ac index 621f4939e98..a9bdd720aad 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -809,8 +809,25 @@ else AC_LANG(C) fi fi -AC_LANG(C) -AC_CHECK_HEADER(mpfr.h,,BUILD_mpfr=yes) +AC_LANG([C]) +AS_IF([test $BUILD_mpfr = no], + [AC_CHECK_HEADER([mpfr.h], + dnl need mpfr >= 4 for mpfr_nrandom, mpfr_beta, mpfr_gamma_inc + [AC_MSG_CHECKING([for mpfr version]) + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([ + #include + #include + ], [ + puts(MPFR_VERSION_STRING); + if (MPFR_VERSION_MAJOR < 4) + return 1; + else + return 0;])],, + [AC_MSG_NOTICE([mpfr >= 4 required; will build]) + BUILD_mpfr=yes])], + [AC_MSG_NOTICE([mpfr headers not found; will build]) + BUILD_mpfr=yes])]) if test $BUILD_mpfr = yes then BUILTLIBS="-lmpfr $BUILTLIBS" else if test $SHARED = no -a $TRY_STATIC = yes From d365915963693692c61609dd27d0f06312469c8b Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 15:27:46 -0400 Subject: [PATCH 078/226] Bump mpfr version to 4.2.1 (autotools) --- M2/libraries/mpfr/Makefile.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/M2/libraries/mpfr/Makefile.in b/M2/libraries/mpfr/Makefile.in index dd48ee82f93..4525a965988 100644 --- a/M2/libraries/mpfr/Makefile.in +++ b/M2/libraries/mpfr/Makefile.in @@ -1,6 +1,6 @@ ############################################################################# -VERSION = 4.0.2 +VERSION = 4.2.1 LICENSEFILES = README COPYING.LESSER TARFILE = $(LIBNAME)-$(VERSION).tar.xz TAROPTIONS = --xz @@ -24,8 +24,7 @@ CONFIGOPTIONS += --disable-thread-safe ############################################################################# RELAX = yes -# URL = http://www.mpfr.org/mpfr-$(VERSION) -URL = http://macaulay2.com/Downloads/OtherSourceCode +URL = https://www.mpfr.org/mpfr-$(VERSION) ifeq (@DEBUG@,yes) CONFIGOPTIONS += --enable-assert From f8f6b9e3c78503ba01517ebb0fd38a0a82591255 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 15:32:40 -0400 Subject: [PATCH 079/226] Use gzip for mpfr like everything else (autotools) Why require xz when upstream provides a gzipped tarball? --- M2/libraries/mpfr/Makefile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/M2/libraries/mpfr/Makefile.in b/M2/libraries/mpfr/Makefile.in index 4525a965988..e3c6e466ad3 100644 --- a/M2/libraries/mpfr/Makefile.in +++ b/M2/libraries/mpfr/Makefile.in @@ -2,8 +2,7 @@ VERSION = 4.2.1 LICENSEFILES = README COPYING.LESSER -TARFILE = $(LIBNAME)-$(VERSION).tar.xz -TAROPTIONS = --xz +TARFILE = $(LIBNAME)-$(VERSION).tar.gz ############################################################################# CONFIGOPTIONS += --disable-thread-safe From 09208cba0bc50ca64569607dd5ffc461e98c4a2e Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 17:47:30 -0400 Subject: [PATCH 080/226] Build tbb if not available (autotools) --- M2/configure.ac | 65 ++++++++++++++++++++---------------- M2/libraries/tbb/Makefile.in | 15 +++++++++ M2/m4/files | 1 + 3 files changed, 53 insertions(+), 28 deletions(-) create mode 100644 M2/libraries/tbb/Makefile.in diff --git a/M2/configure.ac b/M2/configure.ac index a9bdd720aad..ff9d48ea2fc 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -174,6 +174,7 @@ AS_IF([test $WHICH = false], AC_MSG_ERROR([which is required])) AC_CHECK_PROGS(CMP,cmp,false) AS_IF([test $CMP = false], AC_MSG_ERROR([cmp is required (try installing 'diffutils' package)])) +AC_CHECK_PROGS([CMAKE], [cmake], [false]) AC_CHECK_TOOL(AR,ar,false) AC_CHECK_TOOL(AS,as,false) @@ -367,33 +368,6 @@ AC_SEARCH_LIBS(hstrerror,resolv) AC_SEARCH_LIBS(dlopen,dl) AC_SEARCH_LIBS(gethostbyname,nsl) -AC_SUBST([ENABLE_TBB], [yes]) -AC_ARG_ENABLE([tbb], - [AS_HELP_STRING([--disable-tbb], - [disable use of the tbb (threaded building blocks) library])], - [ENABLE_TBB=$enableval]) -AS_IF([test $ENABLE_TBB = yes], - [AC_DEFINE([WITH_TBB], [1], - [whether the tbb library has been enabled by the builder]) - AC_LANG([C++]) - AC_CHECK_HEADER([tbb/tbb.h],, - [AC_MSG_ERROR([tbb include file (tbb.h) not found])]) - AC_SEARCH_LIBS([TBB_runtime_interface_version], [tbb],, - [AC_MSG_ERROR([tbb library not found])]) - AC_RUN_IFELSE( - [AC_LANG_PROGRAM([ - #include - #define TBB_SUPPRESS_DEPRECATED_MESSAGES 1 - #include - ], [ - std::cout << "checking for TBB version... " << TBB_VERSION_MAJOR << - "." << TBB_VERSION_MINOR << std::endl; - if (TBB_VERSION_MAJOR < 2020) - return 1; - else - return 0;])],, - [AC_MSG_ERROR([TBB >= 2020 required])])]) - AC_CHECK_FUNCS([herror error clock_gettime getaddrinfo hstrerror sync getpgrp setpgid fchmod pipe waitpid setrlimit alarm fork sigprocmask kill longjmp siglongjmp sigaction wait4 readlink lstat realpath mkdir link symlink socket accept fcntl personality ioctl]) AC_SUBST(HAVE_PERSONALITY,$ac_cv_func_personality) @@ -659,7 +633,7 @@ AC_SUBST(BUILTLIBS) # (Programs linked by this configure script are linked with the options in LIBS. This allows libraries # dependent on previously detected libraries to be detected by tests that involve linking. -AC_SUBST(LIBLIST, " gc gdbm gmp mpfr mpfi normaliz readline ntl flint factory lapack mpsolve frobby glpk cddlib fplll givaro fflas_ffpack linbox gtest memtailor mathic mathicgb eigen ") +AC_SUBST(LIBLIST, " gc gdbm gmp mpfr mpfi normaliz readline ntl flint factory lapack mpsolve frobby glpk cddlib fplll givaro fflas_ffpack linbox gtest tbb memtailor mathic mathicgb eigen ") # The list LIBLIST is the list of libraries that might be used and linked into M2. AC_SUBST(PROGLIST, "4ti2 gfan csdp nauty cddplus lrslib gftables topcom cohomcalg msolve") @@ -1285,6 +1259,41 @@ then AC_MSG_NOTICE(readline library will be compiled) BUILTLIBS="-lreadline -lhistory $BUILTLIBS" fi +AC_SUBST([ENABLE_TBB], [yes]) +AC_ARG_ENABLE([tbb], + [AS_HELP_STRING([--disable-tbb], + [disable use of the tbb (threaded building blocks) library])], + [ENABLE_TBB=$enableval]) +AS_IF([test $ENABLE_TBB = yes], + [AC_DEFINE([WITH_TBB], [1], + [whether the tbb library has been enabled by the builder]) + AC_LANG([C++]) + AS_IF([test $BUILD_tbb = no], + [AC_CHECK_HEADER([tbb/tbb.h], + [AC_SEARCH_LIBS([TBB_runtime_interface_version], [tbb], + [AC_MSG_CHECKING([for tbb version]) + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([ + #include + #define TBB_SUPPRESS_DEPRECATED_MESSAGES 1 + #include + ], [ + printf("%d.%d\n", TBB_VERSION_MAJOR, TBB_VERSION_MINOR); + if (TBB_VERSION_MAJOR < 2020) + return 1; + else + return 0;])],, + [AC_MSG_NOTICE([tbb >= 2020 required; will build]) + BUILD_tbb=yes])], + [AC_MSG_NOTICE([tbb library not found; will build]) + BUILD_tbb=yes])], + [AC_MSG_NOTICE([tbb include file (tbb.h) not found; will build]) + BUILD_tbb=yes])])]) +AS_IF([test $BUILD_tbb = yes], + [BUILTLIBS="-ltbb $BUILTLIBS" + AS_IF([test $CMAKE = false], + [AC_MSG_ERROR([cmake is required to build tbb])])]) + AC_ARG_WITH([system-memtailor], [AS_HELP_STRING([--with-system-memtailor], [use system memtailor instead of building git submodule])],, diff --git a/M2/libraries/tbb/Makefile.in b/M2/libraries/tbb/Makefile.in new file mode 100644 index 00000000000..146c4f59e3a --- /dev/null +++ b/M2/libraries/tbb/Makefile.in @@ -0,0 +1,15 @@ +HOMEPAGE = https://oneapi-src.github.io/oneTBB/ +VERSION = 2021.13.0 +URL = https://github.com/oneapi-src/oneTBB/archive/refs/tags +TARDIR = oneTBB-$(VERSION) +TARFILE = v$(VERSION).tar.gz +LICENSEFILES = README.md LICENSE.txt + +CONFIGURECMD = @CMAKE@ -DCMAKE_INSTALL_PREFIX=$(LIBRARIESDIR) \ + -DCMAKE_INSTALL_LIBDIR=lib -DTBB_TEST=OFF . + +VLIMIT = unlimited +CHECKCMD = @CMAKE@ -DTBB_TEST=ON . && make && ctest + +include ../Makefile.library +Makefile: @srcdir@/Makefile.in ; cd ../.. && ./config.status libraries/tbb/Makefile diff --git a/M2/m4/files b/M2/m4/files index 610d7c74ddd..2d85d6c7a87 100644 --- a/M2/m4/files +++ b/M2/m4/files @@ -64,6 +64,7 @@ libraries/ntl/Makefile libraries/pari/Makefile libraries/polymake/Makefile libraries/readline/Makefile +libraries/tbb/Makefile libraries/topcom/Makefile Macaulay2/Makefile Macaulay2/README From 37cc64d23db79e1aaf16b6eeedbfcb1d9bd783d4 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 19:35:45 -0400 Subject: [PATCH 081/226] Simplify givaro check (autotools) Don't use pkg-config -- it adds extra flags we already have. Also drop isUnit check -- no longer needed since we don't compile the file that used it anymore. --- M2/configure.ac | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/M2/configure.ac b/M2/configure.ac index ff9d48ea2fc..b2f4201aea9 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -843,27 +843,24 @@ else if test $SHARED = no -a $TRY_STATIC = yes fi fi -AC_MSG_CHECKING([whether givaro library is installed]) -AC_SUBST(BUILD_givaro) -if $PKG_CONFIG --exists givaro -then AC_MSG_RESULT(yes) - LIBS="`$PKG_CONFIG --libs givaro` $LIBS" - CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags-only-I givaro`" - AC_MSG_CHECKING([whether givaro has isUnit or isunit]) - AC_LANG([C++]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( [ #include - ], - [ class Givaro::GFqDom foo; foo.isunit(0) ])], - [AC_MSG_RESULT([isunit]); AC_DEFINE([HAVE_GIVARO_isunit], [1],[whether givaro has isunit])], - [AC_MSG_RESULT([isUnit]); AC_DEFINE([HAVE_GIVARO_isunit], [0],[whether givaro has isunit])]) -else AC_MSG_RESULT(no) - AC_DEFINE([HAVE_GIVARO_isunit], [0],[whether givaro has isunit]) - BUILD_givaro=yes -fi -if test $BUILD_givaro = yes -then BUILTLIBS="-lgivaro $BUILTLIBS" -fi +AS_IF([test $BUILD_givaro = no], + [AC_LANG([C++]) + AC_CHECK_HEADER([givaro/givinteger.h], + [AC_MSG_CHECKING([whether givaro library is installed]) + SAVELIBS=$LIBS + LIBS="$LIBS -lgivaro" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([ + #include + ], [ + Givaro::Integer a;])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no; will build]) + LIBS=$SAVELIBS + BUILD_givaro=yes])], + [AC_MSG_NOTICE([givaro headers not found; will build]) + BUILD_givaro=yes])]) +AS_IF([test $BUILD_givaro = yes], [BUILTLIBS="-lgivaro $BUILTLIBS"]) # We add these directories to the end, so the user can override this by setting CPPFLAGS. # /cddlib/ is more modern than /cdd/ From 3d8d7d477032f497783b132f40ed5b7f4ef6225c Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 19:42:03 -0400 Subject: [PATCH 082/226] Remove unused engine Givaro source files --- M2/Macaulay2/d/Makefile.files.in | 1 - M2/Macaulay2/e/aring-gf-givaro.cpp | 720 ----------------------------- M2/Macaulay2/e/aring-gf-givaro.hpp | 285 ------------ 3 files changed, 1006 deletions(-) delete mode 100644 M2/Macaulay2/e/aring-gf-givaro.cpp delete mode 100644 M2/Macaulay2/e/aring-gf-givaro.hpp diff --git a/M2/Macaulay2/d/Makefile.files.in b/M2/Macaulay2/d/Makefile.files.in index 7b8e4c617c3..89342fe1891 100644 --- a/M2/Macaulay2/d/Makefile.files.in +++ b/M2/Macaulay2/d/Makefile.files.in @@ -177,7 +177,6 @@ interface.o : \ @srcdir@/../e/aring-qq-flint.hpp \ @srcdir@/../e/aring-qq-gmp.hpp \ @srcdir@/../e/aring-m2-gf.hpp \ - @srcdir@/../e/aring-gf-givaro.hpp \ @srcdir@/../e/polyring.hpp \ @srcdir@/../e/skew.hpp \ @srcdir@/../e/qring.hpp \ diff --git a/M2/Macaulay2/e/aring-gf-givaro.cpp b/M2/Macaulay2/e/aring-gf-givaro.cpp deleted file mode 100644 index 5a6bc84b2fb..00000000000 --- a/M2/Macaulay2/e/aring-gf-givaro.cpp +++ /dev/null @@ -1,720 +0,0 @@ -// Copyright 2011 Michael E. Stillman - -#include "aring-gf-givaro.hpp" - -#include "interface/random.h" -#include "error.h" -#include "ringmap.hpp" -#include "monoid.hpp" - -// Uncomment the following line to see debugging output -//#define DEBUG_GF - -namespace M2 { - -// std::vector::Residu_t> irreducible_11_2; -// GFqDom gfqField(11,2,irreducible_11_2); - -ARingGFGivaro::ARingGFGivaro(UTT charact_, UTT extensionDegree_) - : mCharac(charact_), - mDimension(extensionDegree_), - mOriginalRing(0), - givaroField(FieldType(charact_, extensionDegree_)), - givaroRandomIterator(GivaroRandIter(givaroField)) -{ - mCardinality = mCharac; - for (int j = 1; j < mDimension; j++) mCardinality *= mCharac; - - /// @todo remove debug code - /// debug code: - getModPolynomialCoeffs(); - getGeneratorCoeffs(); - - /* - - ARingGFGivaro *testGF = new ARingGFGivaro(charact_, getModPolynomialCoeffs() - ); - - std::cerr <<"random"<< std::endl; - ElementType rnd ; - this->random(rnd); - std::cerr << " rnd = "<< rnd << std::endl; - fieldElementToM2Array(rnd); - fieldElementToM2Array(givaroField.one); - fieldElementToM2Array(givaroField.zero); - */ - - /// end debug -} - -ARingGFGivaro::ARingGFGivaro(UTT charact_, - const M2_arrayint &modPolynomial, - const PolynomialRing &originalRing) - : mCharac(charact_), - mDimension(M2arrayGetDegree(modPolynomial)), - mOriginalRing(&originalRing), - mPrimitiveElement(originalRing.var(0)), - givaroField( - FieldType(charact_, - mDimension, - ARingGFGivaro::M2arrayToStdVec(charact_, modPolynomial))), - givaroRandomIterator(GivaroRandIter(givaroField)) -{ - mCardinality = mCharac; - for (int j = 1; j < mDimension; j++) mCardinality *= mCharac; - - /// @jakob find out if the irreducible polynomial is checked in givaro. - UTT localdegree = M2arrayGetDegree(modPolynomial); - - if (!(modPolynomial->len > 1 && modPolynomial->array[localdegree] > 0)) - { - std::cout << "assertion would have failed" << std::endl; - assert(modPolynomial->len > 1); - assert(modPolynomial->array[localdegree] > 0); - } - /// debug code: - getModPolynomialCoeffs(); -} - -ARingGFGivaro::ARingGFGivaro(UTT charact_, - const M2_arrayint &modPolynomial, - const M2_arrayint &generatorPoly, - const PolynomialRing &originalRing) - : mCharac(charact_), - mDimension(M2arrayGetDegree(modPolynomial)), - mOriginalRing(&originalRing), - mPrimitiveElement(originalRing.var(0)), - givaroField( - FieldType(charact_, - mDimension, - ARingGFGivaro::M2arrayToStdVec(charact_, modPolynomial), - ARingGFGivaro::M2arrayToStdVec(charact_, generatorPoly))), - givaroRandomIterator(GivaroRandIter(givaroField)) -{ - mCardinality = mCharac; - for (int j = 1; j < mDimension; j++) mCardinality *= mCharac; - -#ifdef DEBUG_GF - std::vector debugGenPoly = M2arrayToStdVec(charact_, generatorPoly); - std::cerr << "generatorPoly: "; - for (int i = 0; i < debugGenPoly.size(); i++) - { - std::cerr << debugGenPoly[i] << " "; - } - std::cerr << std::endl; -#endif - /// @jakob find out if the irreducible polynomial is checked in givaro. - UTT localdegree = M2arrayGetDegree(modPolynomial); - - if (!(modPolynomial->len > 1 && modPolynomial->array[localdegree] > 0)) - { - std::cout << "assertion would have failed" << std::endl; - assert(modPolynomial->len > 1); - assert(modPolynomial->array[localdegree] > 0); - } - /// debug code: - getModPolynomialCoeffs(); -} - -M2_arrayint ARingGFGivaro::findMinimalPolynomial(UTT charac, UTT dim) -{ - // ARingGFGivaro tmp(charac,dim); - // return tmp.getModPolynomialCoeffs(); - - FieldType Zp(charac, 1); - // typedef CyclotomicTable< GFqDom, Dense > PolDom; - // PolDom Pdom( Zp, e ); - typedef Givaro::Poly1FactorDom PolDom; - PolDom Pdom(Zp); - PolDom::Element F, G, H; - -// F is irreducible of degree e over Zp -// G is a primitive polynomial for F -// Pdom.random_prim_root(F,G, Degree(e)); - -// F is an irreducible factor of the -// (p^e-1) th cyclotomic polynomial -// G is a primitive polynomial for F : X -// Pdom.getcyclo(F); -// Pdom.init(G, Degree(1), Zp.one); - -// F is irreducible of degree e over Zp -// with X as a primitive polynomial -#ifndef GIVARO_RANDOM_IRREDUCTIBLE_PRIMITIVE_ROOT - Pdom.ixe_irreducible(F, Givaro::Degree((long)dim)); - // Pdom.init(G, Degree(1), Zp.one); - // Pdom.assign(G, Degree(1), Zp.one); - Pdom.init(G, Givaro::Degree(1)); -#else - Pdom.random_irreducible(F, Givaro::Degree((long)dim)); - Pdom.give_random_prim_root(G, F); -#endif - - Pdom.assign(H, G); - - typedef Givaro::Poly1PadicDom PadicDom; - PadicDom PAD(Pdom); - - UTT generator, irreducible; - - PAD.eval(generator, H); - PAD.eval(irreducible, F); - - return (representationToM2Array(irreducible, dim + 1, charac)); -} - -ARingGFGivaro::UTT ARingGFGivaro::M2arrayToGFRepresentation( - ARingGFGivaro::UTT pCharac, - const M2_arrayint &m2array) -{ -#ifdef DEBUG_GF - std::cerr << "M2arrayToGFRepresentation" << std::endl; -#endif - ARingGFGivaro::UTT rep = 0; - assert(m2array->len > 1); - assert(sizeof(m2array->array[0]) < sizeof(ARingGFGivaro::UTT)); - - for (ARingGFGivaro::STT pos = m2array->len - 1; pos >= 0; pos--) - { -#ifdef DEBUG_GF - std::cerr << " m2array->array[" << pos << "]" << m2array->array[pos] - << std::endl; -#endif - if (m2array->array[pos] >= 0) - { - assert((ARingGFGivaro::UTT)(m2array->array[pos]) < pCharac); - rep = rep * pCharac + (m2array->array[pos]); - } - if (m2array->array[pos] < 0) - { - assert((ARingGFGivaro::UTT)(-(m2array->array[pos])) < pCharac); - rep = rep * pCharac + (m2array->array[pos] + pCharac); - } - } - return rep; - std::cerr << "rep" << rep << std::endl; -} - -M2_arrayint ARingGFGivaro::fieldElementToM2Array(ElementType el) const -{ - UTT packedPolynomial; - packedPolynomial = this->givaroField.convert(packedPolynomial, el); -#ifdef DEBUG_GF - std::cerr << "packedPolynomial = " << packedPolynomial << std::endl; -#endif - return elementRepresentationToM2Array(packedPolynomial); -} - -ARingGFGivaro::UTT ARingGFGivaro::M2arrayGetDegree(const M2_arrayint &m2array) -{ - ARingGFGivaro::UTT degree = 0; - ///@jakob find out the type of m2array->len - for (UTT pos = 0; pos < m2array->len; pos++) - { - if (m2array->array[pos] != 0) degree = pos; - } - return degree; -} - -std::vector ARingGFGivaro::M2arrayToStdVec( - ARingGFGivaro::UTT pCharac, - const M2_arrayint &m2array) -{ -// std::vector< UTT > stdvec; -#ifdef DEBUG_GF - std::cerr << "M2arrayToStdVec" << std::endl; -#endif - assert(m2array->len > 0); - - std::vector vec; - - vec.resize(M2arrayGetDegree(m2array) + 1); - - for (UTT pos = 0; pos < m2array->len; pos++) - { - vec[pos] = m2array->array[pos]; - if (m2array->array[pos] >= 0) - { - assert((ARingGFGivaro::UTT)(m2array->array[pos]) < pCharac); - vec[pos] = m2array->array[pos]; - } - if (m2array->array[pos] < 0) - { - assert((ARingGFGivaro::UTT)(-(m2array->array[pos])) < pCharac); - vec[pos] = (m2array->array[pos] + pCharac); - } - } - return vec; -} - -/// @mike correct output : print generator variable of the ring instead of 'X', -/// whatever generator variable will be -void ARingGFGivaro::elem_text_out(buffer &o, - const ElementType a, - bool p_one, - bool p_plus, - bool p_parens) const -{ - UTT rep; - rep = givaroField.convert(rep, a); - long exp = 0; - if (rep == 0) o << "0"; - while (rep != 0) - { - UTT remainder = rep % mCharac; - rep = rep / mCharac; - if (exp > 0) o << " + "; - o << remainder << "*" - << "X^" << exp; - exp++; - } -} - -M2_arrayint ARingGFGivaro::representationToM2Array(UTT representation, - long coeffNum, - UTT charac) -{ -#ifdef DEBUG_GF - std::cerr << "representationToM2Array:\n"; -#endif - M2_arrayint polynomialCoeffs = M2_makearrayint(static_cast(coeffNum)); -#ifdef DEBUG_GF - std::cerr << "coeffNum" << coeffNum << std::endl; - std::cerr << "charac" << charac << std::endl; - std::cerr << "representation" << representation << std::endl; -#endif - long exp = 0; - - while (representation != 0) - { - assert(exp < coeffNum); - UTT remainder = representation % charac; - representation = representation / charac; - polynomialCoeffs->array[exp] = static_cast(remainder); - -#ifdef DEBUG_GF - // debug: - if (exp > 0) std::cerr << " + "; - std::cerr << remainder << "*" - << "X^" << exp; -// end debug -#endif - exp++; - } - assert(representation == 0); - for (; exp < coeffNum; exp++) - { - assert(exp < coeffNum); - polynomialCoeffs->array[exp] = 0; - } -#ifdef DEBUG_GF - std::cerr << "\n"; -#endif - return polynomialCoeffs; -} - -M2_arrayint ARingGFGivaro::representationToM2Array(UTT representation, - long coeffNum) const -{ - return (representationToM2Array(representation, coeffNum, mCharac)); -} - -M2_arrayint ARingGFGivaro::elementRepresentationToM2Array( - UTT polynomialRep) const -{ -#ifdef DEBUG_GF - std::cerr << "representationToM2Array:\n"; -#endif - long coeffNum; - return representationToM2Array(polynomialRep, coeffNum = this->mDimension); -} - -M2_arrayint ARingGFGivaro::modPolynomialRepresentationToM2Array( - UTT polynomialRep) const -{ -#ifdef DEBUG_GF - std::cerr << "modPolynomialRepresentationToM2Array:\n"; -#endif - long coeffNum; - return representationToM2Array(polynomialRep, - coeffNum = this->mDimension + 1); -} - -/// returns mod polynomial coefficients as array of integers. -/// @todo problems, if characteristic does not fit in a int. -M2_arrayint ARingGFGivaro::getModPolynomialCoeffs() const -{ -#ifdef DEBUG_GF - std::cerr << "getModPolynomialCoeffs\n"; -#endif - UTT modPolynomialRepresentation = this->givaroField.irreducible(); - return modPolynomialRepresentationToM2Array(modPolynomialRepresentation); -} - -M2_arrayint ARingGFGivaro::getGeneratorCoeffs() const -{ -#ifdef DEBUG_GF - std::cerr << "getGeneratorCoeffs\n"; -#endif - ElementType genRep, packedGenPolynomial; /// todo: typ (gen) eigentlich UTT? - givaroField.generator(genRep); - packedGenPolynomial = givaroField.generator(); - -#ifdef DEBUG_GF - std::cerr << "packedGenPolynomial " << packedGenPolynomial << std::endl; - std::cerr << "genRep " << genRep << std::endl; -#endif - // assert(gen==genRep); - // UTT generatorRepresentation; - // generatorRepresentation = - // this->givaroField.convert(generatorRepresentation,gen); - // return elementRepresentationToM2Array( generatorRepresentation ) ; - return elementRepresentationToM2Array(packedGenPolynomial); -} - -#if 0 - // Commented out, MES 1 June 2014, as interface to this function has changed substantially. -ring_elem ARingGFGivaro::getGenerator() const -{ -#ifdef DEBUG_GF - std::cerr << " ARingGFGivaro::getGenerator()" << std::endl; -#endif - ElementType packedGenPolynomial = givaroField.generator(); - ElementType genRep; - givaroField.generator(genRep); - -#ifdef DEBUG_GF - std::cerr << "packedGenPolynomial " << packedGenPolynomial << std::endl; - std::cerr << "genRep " << genRep << std::endl; -#endif - - elementRepresentationToM2Array( packedGenPolynomial ) ; - -#ifdef DEBUG_GF - std::cerr << "end elementRepresentationToM2Array " << genRep << std::endl; -#endif - - ring_elem result; - //to_ring_elem(result,packedGenPolynomial); - to_ring_elem(result, genRep); - //std::cerr << " result " << *result << std::endl; - return result; -} -#endif - -void ARingGFGivaro::getGenerator(ElementType &result_gen) const -{ - // ElementType packedGenPolynomial = givaroField.generator(); - givaroField.generator(result_gen); -} - -bool ARingGFGivaro::is_unit(const ElementType f) const -{ -#if HAVE_GIVARO_isunit - return givaroField.isunit(f); -#else - return givaroField.isUnit(f); -#endif -} - -bool ARingGFGivaro::is_zero(const ElementType f) const -{ - return givaroField.isZero(f); -} - -bool ARingGFGivaro::is_equal(const ElementType f, const ElementType g) const -{ - return givaroField.areEqual(f, g); -} - -/// compare exponents of the used generator -int ARingGFGivaro::compare_elems(const ElementType f, const ElementType g) const -{ -#ifdef DEBUG_GF - std::cerr << "ARingGFGivaro::compare_elems" << std::endl; -#endif - if (f < g) return -1; - if (f > g) return 1; - - return 0; -} - -// 'init', 'init_set' functions - -void ARingGFGivaro::init(ElementType &result) const -{ - result = givaroField.zero; -} - -void ARingGFGivaro::clear(ElementType &result) const { /* nothing */} - -void ARingGFGivaro::set_zero(ElementType &result) const -{ - result = givaroField.zero; -} - -void ARingGFGivaro::copy(ElementType &result, const ElementType a) const -{ - result = a; -} - -/// @todo possible problem if type UTT is smaller than an int? -void ARingGFGivaro::set_from_long(ElementType &result, int64_t a) const -{ - // givaroField.init(result, a): returns an element in GF, where - // 0 <= a < p^n. It injects via lexicographic order of p-adic rep: - // 0 --> [0,0,0] - // 1 --> [1,0,0] - // p --> [0,1,0], etc. - ElementType p = static_cast(mCharac); - ElementType a1 = a; - if (a1 < 0 or a1 >= p) - { - a1 = a1 % p; - if (a1 < 0) a1 = a1 + p; - } - // strange: if mCharac isn't cast away from unsigned, - // then in "a % mCharac" a is coerced to unsigned, and get the wrong answer! - // e.g: - // (-5) % (unsigned long)(5) == 1 - // (-5) % (long)(5) == 0. Wow! - givaroField.init(result, a1); -} - -void ARingGFGivaro::set_from_mpz(ElementType &result, mpz_srcptr a) const -{ - UTT b = static_cast(mpz_fdiv_ui(a, mCharac)); - givaroField.init(result, b); -} - -bool ARingGFGivaro::set_from_mpq(ElementType &result, mpq_srcptr a) const -{ - ElementType n, d; - set_from_mpz(n, mpq_numref(a)); - set_from_mpz(d, mpq_denref(a)); - if (is_zero(d)) return false; - divide(result, n, d); - return true; -} - -// arithmetic -void ARingGFGivaro::negate(ElementType &result, const ElementType a) const -{ - givaroField.neg(result, a); -} - -/// if a is zero, the result is 1 , but is that what we expect? -/// I vote for two invert functions, one with this check and one without.(Jakob) -void ARingGFGivaro::invert(ElementType &result, const ElementType a) const -{ - if (givaroField.isZero(a)) ERROR(" division by zero"); - givaroField.inv(result, a); -} - -void ARingGFGivaro::add(ElementType &result, - const ElementType a, - const ElementType b) const -{ - givaroField.add(result, a, b); -} - -void ARingGFGivaro::subtract(ElementType &result, - const ElementType a, - const ElementType b) const -{ - givaroField.sub(result, a, b); -} - -/// @param c[in][out] c = c- a*b -void ARingGFGivaro::subtract_multiple(ElementType &c, - const ElementType a, - const ElementType b) const -{ - givaroField.maxpyin(c, a, b); -} - -void ARingGFGivaro::mult(ElementType &result, - const ElementType a, - const ElementType b) const -{ - givaroField.mul(result, a, b); -} - -void ARingGFGivaro::divide(ElementType &result, - const ElementType a, - const ElementType b) const -{ - if (givaroField.isZero(b)) ERROR(" division by zero"); - givaroField.div(result, a, b); -} - -/// @jakob overflow can occur due to multiplication. use exact mpz for -/// multiply and modulo operation instead! -void ARingGFGivaro::power(ElementType &result, - const ElementType a, - const STT n) const -{ - if (givaroField.isnzero(a)) - { - mpz_t mpz_a; - mpz_t mpz_n; - mpz_t mpz_tmp; - mpz_init(mpz_a); - mpz_init(mpz_n); - mpz_init(mpz_tmp); - mpz_set_si(mpz_n, n); - mpz_set_ui(mpz_a, a); - // std::cerr << "a = " << a << std::endl; - // std::cerr << "mpz_a = " << mpz_a << std::endl; - // std::cerr << "n = " << n << std::endl; - // std::cerr << "mpz_n = " << mpz_n << std::endl; - mpz_fdiv_r_ui(mpz_tmp, mpz_n, givaroField.cardinality() - 1); - mpz_mul(mpz_n, mpz_a, mpz_tmp); - STT tmp = - static_cast(mpz_fdiv_ui(mpz_n, givaroField.cardinality() - 1)); - if (tmp == 0) - { - tmp += givaroField.cardinality() - 1; - // result=givaroField.one; - } - - // std::cerr << "tmp = " << tmp << std::endl; - assert(tmp >= 0); // tmp<0 should never occur - if (tmp < 0) tmp += givaroField.cardinality() - 1; - result = tmp; - mpz_clear(mpz_a); - mpz_clear(mpz_n); - mpz_clear(mpz_tmp); - } - else - { - if (n < 0) ERROR(" division by zero"); - result = 0; - } -} - -///@todo ensure that givaroField.cardinality() fits in a unsigned long, -/// otherwise instead of mpz_fdiv_ui a different function has to be called) -void ARingGFGivaro::power_mpz(ElementType &result, - const ElementType a, - mpz_srcptr n) const -{ - STT n1 = static_cast(mpz_fdiv_ui(n, givaroField.cardinality() - 1)); - - // std::cerr << "exponent = " << n << std::endl; - // std::cerr << "n1 = " << n1 << std::endl; - power(result, a, n1); -} - -///@note duplicate code -void ARingGFGivaro::swap(ElementType &a, ElementType &b) const -{ - ElementType tmp = a; - a = b; - b = tmp; -} - -/** @brief returns x,y s.y. x*a + y*b == 0. - if possible, x is set to 1. - no need to consider the case a==0 or b==0. -*/ - -void ARingGFGivaro::syzygy(const ElementType a, - const ElementType b, - ElementType &x, - ElementType &y) const - -{ - x = givaroField.one; - divide(y, a, b); - negate(y, y); -} - -/// @jakob document possible overflow and other nasty things -void ARingGFGivaro::random(GivaroRandIter &it, ElementType &result) const -{ - givaroField.random(it, result); - // std::cerr << " givaroField.cardinality()" << givaroField.cardinality(); - // std::cerr << " givaroRandomIterator()" << it(); -} - -void ARingGFGivaro::random(ElementType &result) const -{ - return random(givaroRandomIterator, result); - // result = rawRandomInt((int32_t) givaroField.cardinality()); - // result = givaroRandomIterator() % givaroField.cardinality(); -} - -bool ARingGFGivaro::promote(const Ring *Rf, - const ring_elem f, - ElementType &result) const -{ - if (mOriginalRing != Rf) return false; - - result = givaroField.zero; - int exp[1]; - ElementType genRep; - givaroField.generator(genRep); -#ifdef DEBUG_GF - std::cerr << "genRep " << genRep << std::endl; -#endif - for (Nterm *t = f; t != NULL; t = t->next) - { - elem a, b; - - std::pair res = - mOriginalRing->getCoefficientRing()->coerceToLongInteger(t->coeff); - assert(res.first); - set_from_long(a, res.second); - - mOriginalRing->getMonoid()->to_expvector(t->monom, exp); - // exp[0] is the variable we want. Notice that since the ring is a - // quotient, - // this degree is < n (where Q_ = P^n). - power(b, genRep, exp[0]); - mult(a, a, b); - add(result, result, a); - } - return true; -} - -void ARingGFGivaro::lift_to_original_ring(ring_elem &result, - const ElementType &f) const -{ - // This code needs review, and tests. See git issue #612 - if (f == givaroField.zero) - result = mOriginalRing->from_long(0); - else if (f == givaroField.one) - result = mOriginalRing->from_long(1); - else - { - result = mOriginalRing->power(mPrimitiveElement, static_cast(f)); - } -} - -bool ARingGFGivaro::lift(const Ring *Rg, - const ElementType f, - ring_elem &result) const -{ - // Rg = Z/p[x]/F(x) ---> GF(p,n) - // promotion: need to be able to know the value of 'x'. - // lift: need to compute (primite_element)^e - - if (mOriginalRing != Rg) return false; - lift_to_original_ring(result, f); - return true; -} - -void ARingGFGivaro::eval(const RingMap *map, - const elem f, - int first_var, - ring_elem &result) const -{ - result = map->get_ring()->power(map->elem(first_var), f); -} -}; - -// Local Variables: -// compile-command: "make -C $M2BUILDDIR/Macaulay2/e " -// indent-tabs-mode: nil -// End: diff --git a/M2/Macaulay2/e/aring-gf-givaro.hpp b/M2/Macaulay2/e/aring-gf-givaro.hpp deleted file mode 100644 index 85f233bd7bf..00000000000 --- a/M2/Macaulay2/e/aring-gf-givaro.hpp +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright 2011 Michael E. Stillman - -#ifndef _aring_gf_hpp_ -#define _aring_gf_hpp_ - -#include "aring.hpp" -#include "buffer.hpp" -#include "ringelem.hpp" -#include - -#include "polyring.hpp" -class RingMap; - -#if 0 - -#include "aring-m2-gf.hpp" - -namespace M2 { - - - class ARingGFGivaro : public DummyRing - //class ARingGF : public ARingGFM2 - { - public: - static const RingID ringID = ring_GFGivaro; - - typedef M2::ARingGFGivaro ring_type ; - - ARingGFGivaro( long charac_, int dimension_) {}; - ARingGFGivaro( long charac_, - const M2_arrayint & modPolynomial, - const PolynomialRing &originalR - ) {} - ARingGFGivaro( long charac_, - const M2_arrayint & modPolynomial, - const M2_arrayint & primitiveElement, - const PolynomialRing &originalR - ) {} - }; -}; - -#else -#define bool_constant givaro_bool_constant -#include -#include -#include -#include -#include -#include -#include -#include -#include -#undef bool_constant -#include - -namespace M2 { - -/** - @ingroup rings - - @brief wrapper for the Givaro::GFqDom<> galois field implementation -*/ -/// @todo think about deriving from RingInterface AND from Ring -class ARingGFGivaro : public SimpleARing -{ - public: - static const RingID ringID = ring_GFGivaro; - - typedef Givaro::GFqDom FieldType; - typedef FieldType::Element ElementType; - typedef M2::ARingGFGivaro ring_type; - using GivaroRandIter = FieldType::RandIter; - typedef ElementType elem; - typedef std::vector ElementContainerType; - - typedef FieldType::Residu_t UTT; ///< types depends on FieldType definition! - // typedef Signed_Trait::signed_type STT;///< types - // depends on FieldType definition! - - typedef std::make_signed::type STT; - - ARingGFGivaro(UTT charac_, UTT dimension_); - - // returns a polynomial that Givaro would choose for this GF(mCharac^dim). - // We hope that if the polynomial is F(t), that t is a generator of the - // multiplicative group. We need to check this. - // TODO: check whether Givaro can handle F(t) with t not primitive. - static M2_arrayint findMinimalPolynomial(UTT charac, UTT dim); - - ARingGFGivaro(UTT charac_, - const M2_arrayint &modPolynomial, - const PolynomialRing &originalR - // TODO: other information too? - ); - - ARingGFGivaro(UTT charac_, - const M2_arrayint &modPolynomial, - const M2_arrayint &generatorPoly, - const PolynomialRing &originalR - // TODO: other information too? - ); - - const FieldType field() const { return givaroField; } - private: - UTT mCharac; - UTT mDimension; ///< same as extensionDegree - UTT mCardinality; ///< number of elements in the field, if less than some - /// bound, otherwise 0. - - const PolynomialRing *mOriginalRing; - const ring_elem mPrimitiveElement; // is an element of mOriginalRing - - const FieldType givaroField; - - mutable GivaroRandIter givaroRandomIterator; - - M2_arrayint representationToM2Array(UTT representation, long coeffNum) const; - - static M2_arrayint representationToM2Array(UTT representation, - long coeffNum, - UTT charac); - - M2_arrayint modPolynomialRepresentationToM2Array(UTT representation) const; - M2_arrayint elementRepresentationToM2Array(UTT representation) const; - - public: - M2_arrayint fieldElementToM2Array(ElementType el) const; - - private: - static UTT M2arrayToGFRepresentation(UTT pCharac, const M2_arrayint &m2array); - static std::vector M2arrayToStdVec(UTT pCharac, - const M2_arrayint &m2array); - - static UTT M2arrayGetDegree(const M2_arrayint &m2array); - - public: - // ring informational - UTT characteristic() const { return mCharac; } - UTT cardinality() const { return mCardinality; } - unsigned int computeHashValue(const elem &a) const - { - return static_cast(a); - } - - /** @name IO - @{ */ - void text_out(buffer &o) const - { - o << "GF(" << mCharac << "," << mDimension << ",Givaro)"; - } - - void elem_text_out(buffer &o, - const ElementType a, - bool p_one = true, - bool p_plus = false, - bool p_parens = false) const; - - /** @} */ - - /** @name properties - @{ */ - bool is_unit(const ElementType f) const; - bool is_zero(const ElementType f) const; - /** @} */ - - /** @name translation functions - @{ */ - void to_ring_elem(ring_elem &result, const ElementType &a) const - { - result = ring_elem(static_cast(a)); - } - - void from_ring_elem(ElementType &result, const ring_elem &a) const - { - result = a.get_int(); - } - - ElementType from_ring_elem_const(const ring_elem &a) const - { - return a.get_int(); - } - - /** @} */ - - /** @name operators - @{ */ - bool is_equal(const ElementType f, const ElementType g) const; - int compare_elems(const ElementType f, const ElementType g) const; - /** @} */ - - /** @name get functions - @{ */ - M2_arrayint getModPolynomialCoeffs() const; - M2_arrayint getGeneratorCoeffs() const; - - void getGenerator( - ElementType &result_gen) const; // returns the generator in this ring. - const PolynomialRing &originalRing() const { return *mOriginalRing; } - /** @} */ - - /** @name init_set - @{ */ - - void init_set(elem &result, elem a) const { result = a; } - void set(elem &result, elem a) const { result = a; } - void init(elem &result) const; - - void clear(elem &result) const; - - void set_zero(elem &result) const; - - void copy(elem &result, const elem a) const; - - void set_from_long(elem &result, int64_t a) const; - - void set_from_mpz(elem &result, mpz_srcptr a) const; - - bool set_from_mpq(elem &result, mpq_srcptr a) const; - - bool set_from_BigReal(elem &result, gmp_RR a) const { return false; } - void set_var(elem &result, int v) const { result = 1; } - /** @} */ - - /** @name arithmetic - @{ */ - void negate(elem &result, const elem a) const; - - void invert(elem &result, const elem a) const; - - void add(elem &result, const elem a, const elem b) const; - - void subtract(ElementType &result, - const ElementType a, - const ElementType b) const; - - void subtract_multiple(elem &result, const elem a, const elem b) const; - - void mult(elem &result, const elem a, const elem b) const; - - ///@brief test doc - void divide(elem &result, const elem a, const elem b) const; - - void power(elem &result, const elem a, const STT n) const; - - void power_mpz(elem &result, const elem a, mpz_srcptr n) const; - - void syzygy(const ElementType a, - const ElementType b, - ElementType &x, - ElementType &y) const; - /** @} */ - - /** @name misc - @{ */ - void swap(ElementType &a, ElementType &b) const; - - void random(GivaroRandIter &it, ElementType &result) const; - void random(ElementType &result) const; - - /** @} */ - - bool promote(const Ring *Rf, const ring_elem f, ElementType &result) const; - - void lift_to_original_ring(ring_elem &result, const ElementType &f) const; - // GF specific routine, used in getRepresentation - - bool lift(const Ring *Rg, const ElementType f, ring_elem &result) const; - - // map : this --> target(map) - // primelem --> map->elem(first_var) - // evaluate map(f) - void eval(const RingMap *map, - const elem f, - int first_var, - ring_elem &result) const; -}; -}; - -#endif -#endif - -// Local Variables: -// compile-command: "make -C $M2BUILDDIR/Macaulay2/e " -// indent-tabs-mode: nil -// End: From db1dd01b309e52cd102a466796c4b56129a629dd Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 19:52:41 -0400 Subject: [PATCH 083/226] Simplify fflas-ffpack check (autotools) Don't bother adding anything to LIBS -- it's a header only library. Also move so that it's right after the givaro check. --- M2/configure.ac | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/M2/configure.ac b/M2/configure.ac index b2f4201aea9..61ff89e16a2 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -862,6 +862,12 @@ AS_IF([test $BUILD_givaro = no], BUILD_givaro=yes])]) AS_IF([test $BUILD_givaro = yes], [BUILTLIBS="-lgivaro $BUILTLIBS"]) +AS_IF([test $BUILD_fflas_ffpack = no], + [AC_LANG([C++]) + AC_CHECK_HEADER([fflas-ffpack/fflas-ffpack.h],, + [AC_MSG_NOTICE([fflas-ffpack not found; will build]) + BUILD_fflas_ffpack=yes])]) + # We add these directories to the end, so the user can override this by setting CPPFLAGS. # /cddlib/ is more modern than /cdd/ if test -d /usr/local/include/cddlib @@ -1438,21 +1444,6 @@ AC_SUBST(ULIMIT_S,yes) ( ulimit -v 2000 2>/dev/null) || ULIMIT_V=no ( ulimit -s 2000 2>/dev/null) || ULIMIT_S=no -# test for fflas_ffpack -if test $BUILD_fflas_ffpack = no -then AC_MSG_CHECKING([for fflas_ffpack library, version at least 2]) - if command -v fflas-ffpack-config > /dev/null && test "`fflas-ffpack-config --decimal-version`" -gt 20000 - then AC_MSG_RESULT(found) - FFLAS_FFPACK_CXXFLAGS=$(for x in $(fflas-ffpack-config --cflags 2>&1) ; do case $x in (-I*) /bin/echo -n "$x " ;; esac done) - AC_MSG_NOTICE([adding fflas_ffpack flags $FFLAS_FFPACK_CXXFLAGS]) - M2_CXXFLAGS="$M2_CXXFLAGS $FFLAS_FFPACK_CXXFLAGS" - LIBS="$LIBS `fflas-ffpack-config --libs`" dnl note: this might add "-Xpreprocessor -fopenmp" to LIBS, and that will confuse libtool - LIBS=`echo $LIBS | sed 's/-Xpreprocessor -fopenmp//'` - else AC_MSG_RESULT(not found, will build) - BUILD_fflas_ffpack=yes - fi -fi - AC_SUBST(ENABLE_LINBOX,no) AC_ARG_ENABLE(linbox, [AS_HELP_STRING(--enable-linbox,enable building the linbox library and linking with it)], From a221a047339b30b416cddc73ba81b02284aeb79d Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 20:05:11 -0400 Subject: [PATCH 084/226] Use AX_BLAS and AX_LAPACK from autoconf archive --- M2/configure.ac | 139 ++------------- M2/libraries/fflas_ffpack/Makefile.in | 2 +- M2/m4/ax_blas.m4 | 248 ++++++++++++++++++++++++++ M2/m4/ax_lapack.m4 | 134 ++++++++++++++ 4 files changed, 400 insertions(+), 123 deletions(-) create mode 100644 M2/m4/ax_blas.m4 create mode 100644 M2/m4/ax_lapack.m4 diff --git a/M2/configure.ac b/M2/configure.ac index 61ff89e16a2..353269fe8c8 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -19,6 +19,8 @@ m4_include(m4/openmp.m4) m4_include(m4/search-libraries.m4) m4_include(m4/ax_boost_base.m4) m4_include(m4/ax_boost_regex.m4) +m4_include(m4/ax_blas.m4) +m4_include(m4/ax_lapack.m4) dnl define(TO_UPPER,[translit($1, [a-z], [A-Z])]) @@ -424,27 +426,6 @@ then LDFLAGS="$LDFLAGS -faltivec" CXXFLAGS="$CXXFLAGS -faltivec" fi -AC_PROG_FC() dnl check for Fortran compiler presence -USE_FCLIBS=unspecified -AC_ARG_ENABLE(fc-lib-ldflags, - AS_HELP_STRING(--disable-fc-lib-ldflags,[do not use extra libraries for linking with Fortran (the default under Cygwin)]), - USE_FCLIBS=$enableval) - -if test "$USE_FCLIBS" = unspecified -then if test "$ISSUE" = Cygwin - then USE_FCLIBS=no - AC_MSG_NOTICE([by default under Cygwin, not adding linker flags to link with Fortran libraries]) - else USE_FCLIBS=yes - AC_MSG_NOTICE([by default, adding linker flags to link with Fortran libraries]) - fi -fi - -if test "$FC" -then AC_FC_DUMMY_MAIN() - AC_FC_WRAPPERS() - AC_FC_LIBRARY_LDFLAGS() -fi - dnl if test "$PTHREADS" = yes dnl then AC_SEARCH_LIBS(pthread_mutex_trylock,pthread) @@ -843,6 +824,19 @@ else if test $SHARED = no -a $TRY_STATIC = yes fi fi +AC_PROG_FC +AC_FC_LIBRARY_LDFLAGS +AS_IF([test $BUILD_lapack = no], + [AX_BLAS + AX_LAPACK + AS_IF([test $ax_blas_ok = no -o $ax_lapack_ok = no], + [AC_MSG_NOTICE([blas/lapack not found; will build]) + BUILD_lapack=yes])]) +AS_IF([test $BUILD_lapack = yes], + [BLAS_LIBS=-lrefblas + LAPACK_LIBS=-llapack]) +AC_SUBST([LINALGLIBS], ["$LAPACK_LIBS $BLAS_LIBS"]) + AS_IF([test $BUILD_givaro = no], [AC_LANG([C++]) AC_CHECK_HEADER([givaro/givinteger.h], @@ -1536,105 +1530,6 @@ then else AC_DEFINE([FACTORY_STREAMIO], [1], [whether factory was built with --enable-streamio]) fi -AC_SUBST(LINALGLIBS) - -# we need to do the fortran library testing last, in case AC_SEARCH_LIBS adds -# one of them to $LIBS, making it impossible to check for the presence of C or -# C++ libraries. (I'm not sure why putting -llapack on the gcc command line -# needlessly causes the library to be linked against.) -FORTRANUSED=no -if test $BUILD_lapack = yes -then if test $USE_FCLIBS != no - then LIBS="$FCLIBS $LIBS" - fi -else lapack_found=no - blas_found=no - AC_MSG_CHECKING([whether the Accelerate framework for lapack is available]) - LINALGLIBS="-framework Accelerate" - SAVELIBS=$LIBS LIBS="$LINALGLIBS $LIBS" - AC_LANG(C) - AC_LINK_IFELSE( - [AC_LANG_PROGRAM(,[sgemv_();dgetrf_();])], - [USE_FCLIBS=no; blas_found=yes; lapack_found=yes; AC_MSG_RESULT(yes)], - [LINALGLIBS= LIBS=$SAVELIBS; AC_MSG_RESULT(no)]) - if test $blas_found = no - then AC_MSG_CHECKING([whether package blas is provided (by pkg-config)]) - if pkg-config --exists blas - then AC_MSG_RESULT(yes) - blas_found=yes - BLASLIBS=`pkg-config --libs blas` - LIBS="$BLASLIBS $LIBS" - CPPFLAGS="`pkg-config --cflags-only-I blas | sed -e 's=^-I/=-isystem /=g' -e 's= -I/= -isystem /=g'` $CPPFLAGS" - AC_SEARCH_LIBS(sgemv_,,,AC_MSG_ERROR(blas function sgemv_ not found with $BLASLIBS)) - else AC_MSG_RESULT(no) - fi - fi - if test $lapack_found = no - then AC_MSG_CHECKING([whether package lapack is provided (by pkg-config)]) - if pkg-config --exists lapack - then AC_MSG_RESULT(yes) - lapack_found=yes - LAPACKLIBS="`pkg-config --libs lapack`" - LIBS="$LAPACKLIBS $LIBS" - CPPFLAGS="`pkg-config --cflags-only-I lapack | sed -e 's=^-I/=-isystem /=g' -e 's= -I/= -isystem /=g'` $CPPFLAGS" - AC_SEARCH_LIBS(dgetrf_,,,AC_MSG_ERROR(lapack function dgetrf_ not found with $LAPACKLIBS)) - else AC_MSG_RESULT(no) - fi - fi - if test $USE_FCLIBS != no - then LIBS="$FCLIBS $LIBS"; added_fclibs=yes - fi - if test $blas_found = no - then AC_SEARCH_LIBS(sgemv_,refblas blas f77blas atlcblas, - blas_found=yes - if test "none required" != "$ac_cv_search_sgemv_" - then BLASLIBS=$ac_cv_search_sgemv_ - fi - ) - # we've been told that both f77blas and atlcblas are needed. If so, fix this somehow. - fi - if test $lapack_found = no - then AC_SEARCH_LIBS(dgetrf_,lapack atllapack, - lapack_found=yes - if test "none required" != "$ac_cv_search_dgetrf_" - then LAPACKLIBS=$ac_cv_search_dgetrf_ - fi - ) - fi - if test $blas_found = no -o $lapack_found = no - then BUILD_lapack=yes - LINALGLIBS="$LINALGLIBS -llapack -lrefblas" - else LINALGLIBS="$LINALGLIBS $LAPACKLIBS $BLASLIBS" - fi -fi - -if test $BUILD_lapack = yes -then if test $added_fclibs != yes - then LIBS="$FCLIBS $LIBS" - fi - LINALGLIBS="$LINALGLIBS -llapack -lrefblas" - dnl we'll need the fortran compiler to be present to compile lapack - FORTRANUSED=yes - if test "$FC" = "" - then AC_MSG_ERROR([no fortran compiler found (FC not set)]) - else AC_MSG_NOTICE(using fortran compiler $FC) - fi -fi - -dnl This code doesn't seem to be needed, and it wasn't ever working, anyway: -dnl if test $BUILD_lapack = yes -dnl then # test whether the fortran compiler can handle lapack, which, starting with -dnl # version 3.2, requires fortran 90, not fortran 77 -dnl AC_LANG(Fortran) -dnl AC_MSG_CHECKING([whether the fortran compiler is modern enough for lapack]) -dnl AC_COMPILE_IFELSE([intrinsic maxloc], dnl this is said to be a Fortran 90 feature -dnl AC_MSG_RESULT(yes), -dnl AC_MSG_RESULT(no)) -dnl fi - -test "$USE_FCLIBS" = no && FCLIBS= -test "$FORTRANUSED" = no && FCLIBS= - AC_LANG(C) dnl The installation of libxml2 under Mac OS X is problematic: @@ -1956,8 +1851,8 @@ AC_MSG_NOTICE([using FC = $FC]) AC_MSG_NOTICE([using AR = $AR]) AC_MSG_NOTICE([using RANLIB = $RANLIB]) AC_MSG_NOTICE([using LDFLAGS = $LDFLAGS]) -AC_MSG_NOTICE([using BLASLIBS = $BLASLIBS]) -AC_MSG_NOTICE([using LAPACKLIBS = $LAPACKLIBS]) +AC_MSG_NOTICE([using BLAS_LIBS = $BLAS_LIBS]) +AC_MSG_NOTICE([using LAPACK_LIBS = $LAPACK_LIBS]) AC_MSG_NOTICE([using LIBS_GDBM = $LIBS_GDBM]) AC_MSG_NOTICE([using LIBS_GLPK = $LIBS_GLPK]) AC_MSG_NOTICE([using LIBS_GMP = $LIBS_GMP]) diff --git a/M2/libraries/fflas_ffpack/Makefile.in b/M2/libraries/fflas_ffpack/Makefile.in index 9a639805b76..bb63aebec4d 100644 --- a/M2/libraries/fflas_ffpack/Makefile.in +++ b/M2/libraries/fflas_ffpack/Makefile.in @@ -24,7 +24,7 @@ LICENSEFILES = COPYING # INSTALLCMD = $(MKDIR_P) $(LIBRARIESDIR)/include/fflas-ffpack && \ # @INSTALL_DATA@ include/config-blas.h $(LIBRARIESDIR)/include/. && \ # @INSTALL_DATA@ include/fflas-ffpack/*.{h,inl} $(LIBRARIESDIR)/include/fflas-ffpack/. -CONFIGOPTIONS += LIBS="@LINALGLIBS@ @FCLIBS@" +CONFIGOPTIONS += --with-blas-libs="@LINALGLIBS@" include ../Makefile.library Makefile: @srcdir@/Makefile.in ; cd ../.. && ./config.status libraries/fflas_ffpack/Makefile # Local Variables: diff --git a/M2/m4/ax_blas.m4 b/M2/m4/ax_blas.m4 new file mode 100644 index 00000000000..851a25712c4 --- /dev/null +++ b/M2/m4/ax_blas.m4 @@ -0,0 +1,248 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_blas.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro looks for a library that implements the BLAS linear-algebra +# interface (see http://www.netlib.org/blas/). On success, it sets the +# BLAS_LIBS output variable to hold the requisite library linkages. +# +# To link with BLAS, you should link with: +# +# $BLAS_LIBS $LIBS $FLIBS +# +# in that order. FLIBS is the output variable of the +# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is +# sometimes necessary in order to link with F77 libraries. Users will also +# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same +# reason. +# +# Many libraries are searched for, from ATLAS to CXML to ESSL. The user +# may also use --with-blas= in order to use some specific BLAS +# library . In order to link successfully, however, be aware that you +# will probably need to use the same Fortran compiler (which can be set +# via the F77 env. var.) as was used to compile the BLAS library. +# +# ACTION-IF-FOUND is a list of shell commands to run if a BLAS library is +# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is +# not found. If ACTION-IF-FOUND is not specified, the default action will +# define HAVE_BLAS. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2019 Geoffrey M. Oxberry +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 21 + +AU_ALIAS([ACX_BLAS], [AX_BLAS]) +AC_DEFUN([AX_BLAS], [ +AC_PREREQ([2.55]) +AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) +AC_REQUIRE([AC_CANONICAL_HOST]) +ax_blas_ok=no + +AC_ARG_WITH(blas, + [AS_HELP_STRING([--with-blas=], [use BLAS library ])]) +case $with_blas in + yes | "") ;; + no) ax_blas_ok=disable ;; + -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o) + BLAS_LIBS="$with_blas" + ;; + *) BLAS_LIBS="-l$with_blas" ;; +esac + +# Get fortran linker names of BLAS functions to check for. +AC_F77_FUNC(sgemm) +AC_F77_FUNC(dgemm) + +ax_blas_save_LIBS="$LIBS" +LIBS="$LIBS $FLIBS" + +# First, check BLAS_LIBS environment variable +if test $ax_blas_ok = no; then +if test "x$BLAS_LIBS" != x; then + save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" + AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes], [BLAS_LIBS=""]) + AC_MSG_RESULT($ax_blas_ok) + LIBS="$save_LIBS" +fi +fi + +# BLAS linked to by default? (happens on some supercomputers) +if test $ax_blas_ok = no; then + save_LIBS="$LIBS"; LIBS="$LIBS" + AC_MSG_CHECKING([if $sgemm is being linked in already]) + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes]) + AC_MSG_RESULT($ax_blas_ok) + LIBS="$save_LIBS" +fi + +# BLAS linked to by flexiblas? (Default on FC33+ and RHEL9+) + +if test $ax_blas_ok = no; then + AC_CHECK_LIB(flexiblas, $sgemm, [ax_blas_ok=yes + BLAS_LIBS="-lflexiblas"]) +fi + +# BLAS in OpenBLAS library? (http://xianyi.github.com/OpenBLAS/) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(openblas, $sgemm, [ax_blas_ok=yes + BLAS_LIBS="-lopenblas"]) +fi + +# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(atlas, ATL_xerbla, + [AC_CHECK_LIB(f77blas, $sgemm, + [AC_CHECK_LIB(cblas, cblas_dgemm, + [ax_blas_ok=yes + BLAS_LIBS="-lcblas -lf77blas -latlas"], + [], [-lf77blas -latlas])], + [], [-latlas])]) +fi + +# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(blas, $sgemm, + [AC_CHECK_LIB(dgemm, $dgemm, + [AC_CHECK_LIB(sgemm, $sgemm, + [ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], + [], [-lblas])], + [], [-lblas])]) +fi + +# BLAS in Intel MKL library? +if test $ax_blas_ok = no; then + # MKL for gfortran + if test x"$ac_cv_fc_compiler_gnu" = xyes; then + # 64 bit + if test $host_cpu = x86_64; then + AC_CHECK_LIB(mkl_gf_lp64, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread]) + # 32 bit + elif test $host_cpu = i686; then + AC_CHECK_LIB(mkl_gf, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_gf -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_gf -lmkl_sequential -lmkl_core -lpthread]) + fi + # MKL for other compilers (Intel, PGI, ...?) + else + # 64-bit + if test $host_cpu = x86_64; then + AC_CHECK_LIB(mkl_intel_lp64, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread]) + # 32-bit + elif test $host_cpu = i686; then + AC_CHECK_LIB(mkl_intel, $sgemm, + [ax_blas_ok=yes;BLAS_LIBS="-lmkl_intel -lmkl_sequential -lmkl_core -lpthread"],, + [-lmkl_intel -lmkl_sequential -lmkl_core -lpthread]) + fi + fi +fi +# Old versions of MKL +if test $ax_blas_ok = no; then + AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl -lguide -lpthread"],,[-lguide -lpthread]) +fi + +# BLAS in Apple vecLib library? +if test $ax_blas_ok = no; then + save_LIBS="$LIBS"; LIBS="-framework Accelerate $LIBS" + AC_MSG_CHECKING([for $sgemm in -framework Accelerate]) + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes;BLAS_LIBS="-framework Accelerate"]) + AC_MSG_RESULT($ax_blas_ok) + LIBS="$save_LIBS" +fi + +# BLAS in Alpha CXML library? +if test $ax_blas_ok = no; then + AC_CHECK_LIB(cxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lcxml"]) +fi + +# BLAS in Alpha DXML library? (now called CXML, see above) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(dxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-ldxml"]) +fi + +# BLAS in Sun Performance library? +if test $ax_blas_ok = no; then + if test "x$GCC" != xyes; then # only works with Sun CC + AC_CHECK_LIB(sunmath, acosp, + [AC_CHECK_LIB(sunperf, $sgemm, + [BLAS_LIBS="-xlic_lib=sunperf -lsunmath" + ax_blas_ok=yes],[],[-lsunmath])]) + fi +fi + +# BLAS in SCSL library? (SGI/Cray Scientific Library) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(scs, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lscs"]) +fi + +# BLAS in SGIMATH library? +if test $ax_blas_ok = no; then + AC_CHECK_LIB(complib.sgimath, $sgemm, + [ax_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"]) +fi + +# BLAS in IBM ESSL library? (requires generic BLAS lib, too) +if test $ax_blas_ok = no; then + AC_CHECK_LIB(blas, $sgemm, + [AC_CHECK_LIB(essl, $sgemm, + [ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas"], + [], [-lblas $FLIBS])]) +fi + +# Generic BLAS library? +if test $ax_blas_ok = no; then + AC_CHECK_LIB(blas, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lblas"]) +fi + +AC_SUBST(BLAS_LIBS) + +LIBS="$ax_blas_save_LIBS" + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_blas_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1]) + : +else + ax_blas_ok=no + $2 +fi +])dnl AX_BLAS diff --git a/M2/m4/ax_lapack.m4 b/M2/m4/ax_lapack.m4 new file mode 100644 index 00000000000..abaff9d1714 --- /dev/null +++ b/M2/m4/ax_lapack.m4 @@ -0,0 +1,134 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_lapack.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro looks for a library that implements the LAPACK linear-algebra +# interface (see http://www.netlib.org/lapack/). On success, it sets the +# LAPACK_LIBS output variable to hold the requisite library linkages. +# +# To link with LAPACK, you should link with: +# +# $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS +# +# in that order. BLAS_LIBS is the output variable of the AX_BLAS macro, +# called automatically. FLIBS is the output variable of the +# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is +# sometimes necessary in order to link with F77 libraries. Users will also +# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same +# reason. +# +# The user may also use --with-lapack= in order to use some specific +# LAPACK library . In order to link successfully, however, be aware +# that you will probably need to use the same Fortran compiler (which can +# be set via the F77 env. var.) as was used to compile the LAPACK and BLAS +# libraries. +# +# ACTION-IF-FOUND is a list of shell commands to run if a LAPACK library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_LAPACK. +# +# LICENSE +# +# Copyright (c) 2009 Steven G. Johnson +# Copyright (c) 2019 Geoffrey M. Oxberry +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 10 + +AU_ALIAS([ACX_LAPACK], [AX_LAPACK]) +AC_DEFUN([AX_LAPACK], [ +AC_REQUIRE([AX_BLAS]) +ax_lapack_ok=no + +AC_ARG_WITH(lapack, + [AS_HELP_STRING([--with-lapack=], [use LAPACK library ])]) +case $with_lapack in + yes | "") ;; + no) ax_lapack_ok=disable ;; + -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o) + LAPACK_LIBS="$with_lapack" + ;; + *) LAPACK_LIBS="-l$with_lapack" ;; +esac + +# Get fortran linker name of LAPACK function to check for. +AC_F77_FUNC(cheev) + +# We cannot use LAPACK if BLAS is not found +if test "x$ax_blas_ok" != xyes; then + ax_lapack_ok=noblas + LAPACK_LIBS="" +fi + +# First, check LAPACK_LIBS environment variable +if test "x$LAPACK_LIBS" != x; then + save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" + AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [$cheev])], [ax_lapack_ok=yes], [LAPACK_LIBS=""]) + AC_MSG_RESULT($ax_lapack_ok) + LIBS="$save_LIBS" + if test $ax_lapack_ok = no; then + LAPACK_LIBS="" + fi +fi + +# LAPACK linked to by default? (is sometimes included in BLAS lib) +if test $ax_lapack_ok = no; then + save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" + AC_CHECK_FUNC($cheev, [ax_lapack_ok=yes]) + LIBS="$save_LIBS" +fi + +# Generic LAPACK library? +for lapack in lapack lapack_rs6k; do + if test $ax_lapack_ok = no; then + save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" + AC_CHECK_LIB($lapack, $cheev, + [ax_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS]) + LIBS="$save_LIBS" + fi +done + +AC_SUBST(LAPACK_LIBS) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_lapack_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1]) + : +else + ax_lapack_ok=no + $2 +fi +])dnl AX_LAPACK From b7e5b9d7db6a0bd2b6e2eb776dc4d669e8862071 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 26 Sep 2024 20:30:34 -0400 Subject: [PATCH 085/226] Remove --disable-simd configure options for fflas-ffpack/givaro No longer supported --- M2/libraries/fflas_ffpack/Makefile.in | 4 ---- M2/libraries/givaro/Makefile.in | 5 ----- 2 files changed, 9 deletions(-) diff --git a/M2/libraries/fflas_ffpack/Makefile.in b/M2/libraries/fflas_ffpack/Makefile.in index bb63aebec4d..a6253911a98 100644 --- a/M2/libraries/fflas_ffpack/Makefile.in +++ b/M2/libraries/fflas_ffpack/Makefile.in @@ -14,10 +14,6 @@ TARFILE = fflas-ffpack-$(VERSION).tar.gz # there seems to be no way to omit them with the "-o" option to "make" CHECKTARGET = check TESTS="test-lu test-det test-echelon test-rankprofiles test-compressQ test-permutations test-fadd test-finit test-fscal test-fgemm test-fgemm-check test-ftrsm-check test-invert-check test-charpoly-check test-fger test-multifile test-maxdelayeddim regression-check" -# We disable simd here because otherwise, we get compiler error message from clang under Mac OS about -# always-inlined functions requiring target feature "xsave"; it's an interaction between givaro and fflas-ffpack. -CONFIGOPTIONS += --disable-simd - CONFIGOPTIONS += --disable-openmp LICENSEFILES = COPYING diff --git a/M2/libraries/givaro/Makefile.in b/M2/libraries/givaro/Makefile.in index 961a2e6c403..28c9c884397 100644 --- a/M2/libraries/givaro/Makefile.in +++ b/M2/libraries/givaro/Makefile.in @@ -19,11 +19,6 @@ LICENSEFILES = COPYRIGHT Licence_CeCILL-B_V1-en.txt Licence_CeCILL-B_V1-fr.txt # had a chance to initialize it. CONFIGOPTIONS += --disable-shared -# Disable vectorized instructions: SSE4.1, AVX, AVX2: -# (this is needed if we wish to distribute binaries to others. But it might be bad -# for us if we don't. So the configure script should have an option for that.) -CONFIGOPTIONS += --disable-simd - include ../Makefile.library Makefile: @srcdir@/Makefile.in ; cd ../.. && ./config.status libraries/givaro/Makefile # Local Variables: From b952939f356aff054900765b50176cb9d4436bc9 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 27 Sep 2024 09:50:47 -0400 Subject: [PATCH 086/226] Install OpenBLAS on Ubuntu GitHub builds --- .github/workflows/test_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_build.yml b/.github/workflows/test_build.yml index 2d58a951ce3..72d4b6662e9 100644 --- a/.github/workflows/test_build.yml +++ b/.github/workflows/test_build.yml @@ -81,7 +81,7 @@ jobs: sudo apt-get update sudo apt-get install -y -q --no-install-recommends clang-16 gfortran libtool-bin ninja-build yasm ccache sudo apt-get install -y -q --no-install-recommends liblzma-dev libboost-stacktrace-dev \ - libncurses-dev libncurses5-dev libreadline-dev libeigen3-dev liblapack-dev libxml2-dev \ + libncurses-dev libncurses5-dev libreadline-dev libeigen3-dev libopenblas-dev libxml2-dev \ libgc-dev libgdbm-dev libglpk-dev libgmp3-dev libgtest-dev libmpfr-dev libmpfi-dev libntl-dev gfan \ libgivaro-dev libboost-regex-dev fflas-ffpack libflint-dev libmps-dev libfrobby-dev \ libsingular-dev singular-data libcdd-dev cohomcalg topcom 4ti2 libnormaliz-dev normaliz coinor-csdp \ From 8ca2eb95c47436480c33afc4ac74fc2d032abc13 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 27 Sep 2024 10:53:25 -0400 Subject: [PATCH 087/226] Set F77 environment variable for GitHub builds gfortan isn't available on the macOS GitHub runners, but gfortran-XX is for various versions XX. Using the latest version (14) for now --- .github/workflows/test_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_build.yml b/.github/workflows/test_build.yml index 72d4b6662e9..d3f1698623c 100644 --- a/.github/workflows/test_build.yml +++ b/.github/workflows/test_build.yml @@ -160,6 +160,7 @@ jobs: export CPPFLAGS="-I`brew --prefix`/include -I`brew --prefix libomp`/include" export LDFLAGS="-L`brew --prefix`/lib -L`brew --prefix libomp`/lib \ -L/Library/Frameworks/Python.framework/Versions/${PYVERSION}/lib" + export F77=gfortran-14 ../../configure --enable-download --with-system-gc - name: Build Macaulay2 using Make From e374541c72f780fd2c4c4df702010f3702b00e17 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 27 Sep 2024 13:19:30 -0400 Subject: [PATCH 088/226] Add patch to improve fflas-ffpack BLAS detection --- M2/libraries/fflas_ffpack/Makefile.in | 2 +- M2/libraries/fflas_ffpack/patch-2.5.0 | 57 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 M2/libraries/fflas_ffpack/patch-2.5.0 diff --git a/M2/libraries/fflas_ffpack/Makefile.in b/M2/libraries/fflas_ffpack/Makefile.in index a6253911a98..5f249695533 100644 --- a/M2/libraries/fflas_ffpack/Makefile.in +++ b/M2/libraries/fflas_ffpack/Makefile.in @@ -6,7 +6,7 @@ SUBMODULE = true VERSION = 2.5.0 PRECONFIGURE = autoreconf -vif -# PATCHFILE = @abs_srcdir@/patch-$(VERSION) +PATCHFILE = @abs_srcdir@/patch-$(VERSION) TARDIR = fflas-ffpack-$(VERSION) TARFILE = fflas-ffpack-$(VERSION).tar.gz diff --git a/M2/libraries/fflas_ffpack/patch-2.5.0 b/M2/libraries/fflas_ffpack/patch-2.5.0 new file mode 100644 index 00000000000..5b4996168f4 --- /dev/null +++ b/M2/libraries/fflas_ffpack/patch-2.5.0 @@ -0,0 +1,57 @@ +From 2cd3a04050f2fa447d8a9c8265f32f25f4cb6546 Mon Sep 17 00:00:00 2001 +From: Jerry James +Date: Mon, 13 Nov 2023 09:36:10 -0700 +Subject: [PATCH] Give cblas_ssyrk a return type + +From 97ee718ebc054d3dda020223a7d777786f7ad924 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Tue, 14 Nov 2023 09:04:55 -0500 +Subject: [PATCH] Fix ryk/yrk typo in config-blas.h + +From 9994f6aa5fc2e3677b14c3d12671ba46ce5a58b5 Mon Sep 17 00:00:00 2001 +From: Doug Torrance +Date: Fri, 27 Sep 2024 13:38:29 -0400 +Subject: [PATCH] Add declarations for ssyrk_ and dsyrk_ when cblas is not + available + +diff -u b/fflas-ffpack/config-blas.h b/fflas-ffpack/config-blas.h +--- b/fflas-ffpack/config-blas.h ++++ fflas-ffpack-2.5.0/fflas-ffpack/config-blas.h +@@ -128,6 +128,8 @@ extern "C" { + void strmm_ (const char*, const char*, const char*, const char*, const int*, const int*, const float*, const float*, const int*, float*, const int*); + void sgemm_ (const char*, const char*, const int*, const int*, const int*, const float*, const float*, const int*, const float*, const int*, const float*, float*, const int*); + void dgemm_ (const char*, const char*, const int*, const int*, const int*, const double*, const double*, const int*, const double*, const int*, const double*, double*, const int*); ++ void ssyrk_ (const char*, const char*, const int*, const int*, const float*, const float*, const int*, const float*, float*, const int*); ++ void dsyrk_ (const char*, const char*, const int*, const int*, const double*, const double*, const int*, const double*, double*, const int*); + } + + // define C wrappers +@@ -288,23 +290,23 @@ extern "C" { + sgemm_ ( EXT_BLAS_TRANSPOSE(TransA), EXT_BLAS_TRANSPOSE(TransB), &M, &N, &K, &alpha, A, &lda, B, &ldb, &beta, C, &ldc); + } + +- static inline cblas_ssyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, ++ static inline void cblas_ssyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, + const enum CBLAS_TRANSPOSE Trans, const int N, const int K, + const float alpha, const float *A, const int lda, + const float beta, float *C, const int ldc){ + if (Order == CblasRowMajor) +- ssryk_ (EXT_BLAS_UPLO_tr(Uplo), EXT_BLAS_TRANSPOSE(Trans), N, K, alpha, A, lda, beta, C, ldc); // @TODO check this ++ ssyrk_ (EXT_BLAS_UPLO_tr(Uplo), EXT_BLAS_TRANSPOSE(Trans), &N, &K, &alpha, A, &lda, &beta, C, &ldc); // @TODO check this + else +- ssryk_ (EXT_BLAS_UPLO (Uplo), EXT_BLAS_TRANSPOSE(Trans), N, K, alpha, A, lda, beta, C, ldc); ++ ssyrk_ (EXT_BLAS_UPLO (Uplo), EXT_BLAS_TRANSPOSE(Trans), &N, &K, &alpha, A, &lda, &beta, C, &ldc); + } + void cblas_dsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, + const enum CBLAS_TRANSPOSE Trans, const int N, const int K, + const double alpha, const double *A, const int lda, + const double beta, double *C, const int ldc){ + if (Order == CblasRowMajor) +- dsryk_ (EXT_BLAS_UPLO_tr(Uplo), EXT_BLAS_TRANSPOSE(Trans), N, K, alpha, A, lda, beta, C, ldc); // @TODO check this ++ dsyrk_ (EXT_BLAS_UPLO_tr(Uplo), EXT_BLAS_TRANSPOSE(Trans), &N, &K, &alpha, A, &lda, &beta, C, &ldc); // @TODO check this + else +- dsryk_ (EXT_BLAS_UPLO (Uplo), EXT_BLAS_TRANSPOSE(Trans), N, K, alpha, A, lda, beta, C, ldc); ++ dsyrk_ (EXT_BLAS_UPLO (Uplo), EXT_BLAS_TRANSPOSE(Trans), &N, &K, &alpha, A, &lda, &beta, C, &ldc); + } + + } From c78e36d52308962e908347a4c4e49260f7d09a49 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 27 Sep 2024 14:05:34 -0400 Subject: [PATCH 089/226] Pass fortran libs to fflas-ffpack configure script Otherwise it won't be able to link the test program it uses to detect BLAS. --- M2/libraries/fflas_ffpack/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/libraries/fflas_ffpack/Makefile.in b/M2/libraries/fflas_ffpack/Makefile.in index 5f249695533..14f87e74f18 100644 --- a/M2/libraries/fflas_ffpack/Makefile.in +++ b/M2/libraries/fflas_ffpack/Makefile.in @@ -20,7 +20,7 @@ LICENSEFILES = COPYING # INSTALLCMD = $(MKDIR_P) $(LIBRARIESDIR)/include/fflas-ffpack && \ # @INSTALL_DATA@ include/config-blas.h $(LIBRARIESDIR)/include/. && \ # @INSTALL_DATA@ include/fflas-ffpack/*.{h,inl} $(LIBRARIESDIR)/include/fflas-ffpack/. -CONFIGOPTIONS += --with-blas-libs="@LINALGLIBS@" +CONFIGOPTIONS += --with-blas-libs="@LINALGLIBS@ @FCLIBS@" include ../Makefile.library Makefile: @srcdir@/Makefile.in ; cd ../.. && ./config.status libraries/fflas_ffpack/Makefile # Local Variables: From 580e21aca1366ea8ab53dd91bbb8f2b9019f108b Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 27 Sep 2024 15:36:44 -0400 Subject: [PATCH 090/226] Fetch submodules before trying to copy their contents (autotools) --- M2/libraries/Makefile.library.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/M2/libraries/Makefile.library.in b/M2/libraries/Makefile.library.in index 30f05e3e922..5cfdfffab77 100644 --- a/M2/libraries/Makefile.library.in +++ b/M2/libraries/Makefile.library.in @@ -94,7 +94,8 @@ BUILDDIR ?= $(UNTARDIR)/$(TARDIR) TAROPTIONS ?= --gzip ifeq ($(SUBMODULE),true) UNTARCMD ?= $(MKDIR_P) $(TARDIR) && \ - cp -r @abs_top_srcdir@/submodules/$(LIBNAME)/* $(TARDIR) + $(MAKE) -C .. fetch && \ + cp -r @abs_top_srcdir@/submodules/$(LIBNAME)/* $(TARDIR) else UNTARCMD ?= @TAR@ xf $(TARFILE_DIR)/$(TARFILE) $(TAROPTIONS) endif From 3495bab3be1cdd258683b6bfaf7c680809144873 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 27 Sep 2024 16:39:34 -0400 Subject: [PATCH 091/226] Add another fflas-ffpack patch; need "static inline" --- M2/libraries/fflas_ffpack/patch-2.5.0 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/M2/libraries/fflas_ffpack/patch-2.5.0 b/M2/libraries/fflas_ffpack/patch-2.5.0 index 5b4996168f4..691a75f0285 100644 --- a/M2/libraries/fflas_ffpack/patch-2.5.0 +++ b/M2/libraries/fflas_ffpack/patch-2.5.0 @@ -14,6 +14,11 @@ Date: Fri, 27 Sep 2024 13:38:29 -0400 Subject: [PATCH] Add declarations for ssyrk_ and dsyrk_ when cblas is not available +From b559549fb3f4abfa69ca7e5da337544ab02c44a1 Mon Sep 17 00:00:00 2001 +From: Doug Torrance +Date: Fri, 27 Sep 2024 16:33:16 -0400 +Subject: [PATCH] Add missing "static inline" to cblas_dsyrk wrapper + diff -u b/fflas-ffpack/config-blas.h b/fflas-ffpack/config-blas.h --- b/fflas-ffpack/config-blas.h +++ fflas-ffpack-2.5.0/fflas-ffpack/config-blas.h @@ -42,7 +47,8 @@ diff -u b/fflas-ffpack/config-blas.h b/fflas-ffpack/config-blas.h - ssryk_ (EXT_BLAS_UPLO (Uplo), EXT_BLAS_TRANSPOSE(Trans), N, K, alpha, A, lda, beta, C, ldc); + ssyrk_ (EXT_BLAS_UPLO (Uplo), EXT_BLAS_TRANSPOSE(Trans), &N, &K, &alpha, A, &lda, &beta, C, &ldc); } - void cblas_dsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, +- void cblas_dsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, ++ static inline void cblas_dsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans, const int N, const int K, const double alpha, const double *A, const int lda, const double beta, double *C, const int ldc){ From d0d6bbdc435953788d34db9f631b134af5dff43c Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 27 Sep 2024 16:47:43 -0400 Subject: [PATCH 092/226] Remove "--without-blas" from flint configure options (autotools) --- M2/libraries/flint/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/libraries/flint/Makefile.in b/M2/libraries/flint/Makefile.in index 79cb1190f38..9cbfad43695 100644 --- a/M2/libraries/flint/Makefile.in +++ b/M2/libraries/flint/Makefile.in @@ -17,7 +17,7 @@ endif CFLAGS += -std=c90 -pedantic-errors PRECONFIGURE = ./bootstrap.sh -CONFIGOPTIONS += --without-blas --disable-shared +CONFIGOPTIONS += --disable-shared ifneq ($(VERBOSE),) BUILDOPTIONS += AT= QUIET_CC= QUIET_CXX= QUIET_AR= From 415ab4c5438fa86798aa0eb588b1c9b14e76a7c7 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 27 Sep 2024 19:29:10 -0400 Subject: [PATCH 093/226] Link against BLAS/LAPACK during engine unit tests --- M2/Macaulay2/e/unit-tests/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/e/unit-tests/Makefile.in b/M2/Macaulay2/e/unit-tests/Makefile.in index 3dd581d79f8..936e9912985 100644 --- a/M2/Macaulay2/e/unit-tests/Makefile.in +++ b/M2/Macaulay2/e/unit-tests/Makefile.in @@ -15,7 +15,7 @@ CPPFLAGS := -I. -I@srcdir@ -I@srcdir@/.. $(CPPFLAGS) \ CXXFLAGS += -std=gnu++17 -Wno-sign-conversion #-Wno-unused-local-typedefs -coverage # note: on some machines, gcc can't find -lstdc++ -LOADLIBES += @BUILTLIBS@ @LIBS@ @FCLIBS@ -pthread +LOADLIBES += @BUILTLIBS@ @LINALGLIBS@ @LIBS@ @FCLIBS@ -pthread # do not link with gtest -- it's supposed to get compiled in via #include: # LDFLAGS += -L$(GTEST_DIR)/lib/.libs From ca6510125d14a9fb8ff492135e14fd605e5e63f7 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 27 Sep 2024 20:49:18 -0400 Subject: [PATCH 094/226] Remove unnecessary givaro isunit v. isUnit check (cmake) --- M2/cmake/check-libraries.cmake | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/M2/cmake/check-libraries.cmake b/M2/cmake/check-libraries.cmake index 9707b9e2a07..9106caaae9f 100644 --- a/M2/cmake/check-libraries.cmake +++ b/M2/cmake/check-libraries.cmake @@ -319,16 +319,7 @@ unset(CMAKE_REQUIRED_LIBRARIES) unset(CMAKE_REQUIRED_INCLUDES) ############################################################################### -## Set four library related definitions - -if(GIVARO_FOUND) - set(CMAKE_REQUIRED_INCLUDES "${GIVARO_INCLUDE_DIRS}") - # whether givaro has isUnit (4.0.3) or isunit (4.0.2) - check_cxx_source_compiles([[#include - int main(){class Givaro::GFqDom foo; foo.isunit(0);return 0;}]] HAVE_GIVARO_isunit) -else() - unset(HAVE_GIVARO_isunit CACHE) -endif() +## Set several library related definitions if(FACTORY_FOUND) set(CMAKE_REQUIRED_INCLUDES "${FACTORY_INCLUDE_DIR}") From fd0eb45576f66aeb415102361fd6310fe4d418a4 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 30 Sep 2024 15:36:47 -0400 Subject: [PATCH 095/226] Add Dockerfile for Red Hat Enterprise Linux [ci skip] --- M2/BUILD/docker/rhel/Dockerfile | 24 ++++++++++++++++++++++++ M2/BUILD/docker/rhel/Makefile | 28 ++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 M2/BUILD/docker/rhel/Dockerfile create mode 100644 M2/BUILD/docker/rhel/Makefile diff --git a/M2/BUILD/docker/rhel/Dockerfile b/M2/BUILD/docker/rhel/Dockerfile new file mode 100644 index 00000000000..64b8e7733d1 --- /dev/null +++ b/M2/BUILD/docker/rhel/Dockerfile @@ -0,0 +1,24 @@ +ARG DISTRIBUTION=rockylinux +ARG RELEASE=8 + +FROM $DISTRIBUTION:$RELEASE +ARG RELEASE + +# Configure EPEL +RUN dnf install -y 'dnf-command(config-manager)' && \ + if [ $RELEASE = 8 ]; \ + then \ + dnf config-manager --set-enabled powertools; \ + else \ + dnf config-manager --set-enabled crb; \ + fi && \ + dnf install -y epel-release + +# Install dependencies +RUN dnf -y install autoconf automake bison boost-devel bzip2 cmake \ + diffutils eigen3 flex gc-devel gcc-c++ gcc-gfortran gdbm-devel git \ + glpk-devel gmp-devel lapack-devel libffi-devel libtool \ + libxml2-devel make mpfr-devel ncurses-devel openblas-devel patch \ + python3-devel readline-devel tbb-devel which xz-devel zlib-devel + +WORKDIR /home/macaulay diff --git a/M2/BUILD/docker/rhel/Makefile b/M2/BUILD/docker/rhel/Makefile new file mode 100644 index 00000000000..2f21d65d7a2 --- /dev/null +++ b/M2/BUILD/docker/rhel/Makefile @@ -0,0 +1,28 @@ +include ../Makefile + +## Parameters +DISTRIBUTION = rockylinux +RELEASE = 8 +BUILD = autotools +TAG = m2-$(BUILD)-$(DISTRIBUTION)-$(RELEASE)-build +BUILD_DIR = M2/BUILD/build-docker + +## Script for building Macaulay2 (autotools) +define M2_BUILD_SCRIPT_autotools +set -xe + +git config --global --add safe.directory $(M2_HOME)/M2 +pushd M2/M2 && ./autogen.sh && popd +mkdir -p M2/$(BUILD_DIR) +cd M2/$(BUILD_DIR) +$(M2_HOME)/M2/M2/configure --with-system-gc --enable-download +make +endef +export M2_BUILD_SCRIPT_autotools + +############################################################################### +# Build targets + +build: build-image + docker run $(VOLUME) -it --entrypoint="" $(TAG) \ + bash -c "$$M2_BUILD_SCRIPT_$(BUILD)" From 0567a28718caccf95970a3a61c296f5bc9643945 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 1 Oct 2024 13:23:45 -0400 Subject: [PATCH 096/226] Drop "get" example from "runProgram" docs. It's not directly related to runProgram. Add a bit more detail about how "get" might be used (by adding a leading "!"), and also link to the docs for the various "open*" functions that also take a string with a leading "!" to interact with a program. The primary reason we're dropping this is example is that it called gfan, which may not be on the PATH, especially if we've just built it. --- .../packages/Macaulay2Doc/functions/runProgram-doc.m2 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/runProgram-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/runProgram-doc.m2 index 0ca54cfe929..7db6e5dc611 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/runProgram-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/runProgram-doc.m2 @@ -103,9 +103,8 @@ doc /// peek oo Text Internally, this routine uses @TO run@. - Another method to interact with programs is @TO get@. - Example - get "!gfan _version" + Another way to interact with programs is to pass a string beginning + with "!" to @TO get@, @TO openIn@, @TO openOut@, or @TO openInOut@. SeeAlso ProgramRun findProgram From d030b8071f2603cfc64d9a3984fd140ac2eea918 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 2 Oct 2024 10:46:40 -0400 Subject: [PATCH 097/226] Drop mpfr_add example from ForeignFunctions::mpfrT docs It will only work if we've dynamically linked against mpfr, which may not be the case. --- M2/Macaulay2/packages/ForeignFunctions.m2 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index a17f75507d4..a7d86d74891 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -965,10 +965,6 @@ doc /// Example mpfrT numeric(100, pi) value oo - mpfrAdd = foreignFunction("mpfr_add", void, {mpfrT, mpfrT, mpfrT, int}) - x = mpfrT 0p100 - mpfrAdd(x, numeric(100, pi), exp 1p100, 0) - x /// doc /// From 6b34475d572b8c8d278c9de9b5d9e79064db82f1 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 2 Oct 2024 10:52:28 -0400 Subject: [PATCH 098/226] Drop mfpr example from ForeignFunction::foreignFunction docs It will only work if mpfr is available as a dynamic library and we've linked against it, which may not be the case. Replace it with "cos" from the C standard math library --- M2/Macaulay2/packages/ForeignFunctions.m2 | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index a7d86d74891..732816b0911 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -1763,18 +1763,12 @@ doc /// Text Load a function contained in a shared library using the C function @TT "dlsym"@ and declare its signature. - Example - mpfr = openSharedLibrary "mpfr" - mpfrVersion = foreignFunction(mpfr, "mpfr_get_version", charstar, void) - mpfrVersion() - Text The library may be omitted if it is already loaded, e.g., for functions in the C standard library or libraries that Macaulay2 is already linked - against. For example, since Macaulay2 uses @TT "mpfr"@ for its - arbitrary precision real numbers, the above example may be simplified. + against. Example - mpfrVersion = foreignFunction("mpfr_get_version", charstar, void) - mpfrVersion() + mycos = foreignFunction("cos", double, double) + mycos pi Text If a function takes multiple arguments, then provide these argument types using a list. From 9c3718ae81f2de6a75fd65474d43660e8f2943ea Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 2 Oct 2024 12:07:56 -0400 Subject: [PATCH 099/226] Use errno for ForeignFunctions::foreignSymbol example It's in the C standard library, so we know that it will be available. Closes: #3374 --- M2/Macaulay2/packages/ForeignFunctions.m2 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index 732816b0911..f193f177dcc 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -1829,15 +1829,10 @@ doc /// Text This function is a wrapper around the C function @TT "dlsym"@. It loads a symbol from a shared library using the specified foreign type. - Example - mps = openSharedLibrary "mps" - cplxT = foreignStructType("cplx_t", {"r" => double, "i" => double}) - foreignSymbol(mps, "cplx_i", cplxT) - Text If the shared library is already linked against Macaulay2, then it may be omitted. Example - foreignSymbol("cplx_i", cplxT) + foreignSymbol("errno", int) /// doc /// From 1f6c59ee3417d03d426416655731a044caa15c13 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 18 Oct 2024 16:08:07 -0400 Subject: [PATCH 100/226] Copy config.guess, config.sub, and install-sh if necessary Older versions of autoconf don't install them automatically [ci skip] --- M2/autogen.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/M2/autogen.sh b/M2/autogen.sh index 148021eac99..bb2ed3709f5 100755 --- a/M2/autogen.sh +++ b/M2/autogen.sh @@ -5,6 +5,22 @@ set -e echo "-- Generating configure script" autoreconf --verbose --force --install +# These files may not be created by older versions of autoconf +if test ! -f config.guess +then + cp -v $(automake --print-libdir)/config.guess . +fi + +if test ! -f config.sub +then + cp -v $(automake --print-libdir)/config.sub . +fi + +if test ! -f install-sh +then + cp -v $(automake --print-libdir)/install-sh . +fi + if test ! -f Macaulay2/editors/emacs/M2.el then if test -e ../.git From f50dc4c9d8e91c73c4997c9f7ee259629341ed0a Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 18 Oct 2024 16:17:47 -0400 Subject: [PATCH 101/226] Add some missing Makefile's to .gitignore Also use a wildcard for the Makefile's in the subdirectories of libraries for simplicity and ease of maintenance. [ci skip] --- M2/.gitignore | 42 +++--------------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/M2/.gitignore b/M2/.gitignore index 7148daeb3c0..416d0cb71f8 100644 --- a/M2/.gitignore +++ b/M2/.gitignore @@ -42,47 +42,10 @@ /Macaulay2/bin/M2 /Macaulay2/c/.gdbinit /Macaulay2/m2/.gdbinit -/libraries/atomic_ops/Makefile -/libraries/cohomcalg/Makefile -/libraries/csdp/Makefile -/libraries/topcom/Makefile -/libraries/M2/Makefile -/libraries/gc/Makefile -/libraries/gdbm/Makefile -/libraries/flint/Makefile -/libraries/gmp/Makefile -/libraries/mpfr/Makefile -/libraries/mpir/Makefile -/libraries/boost/Makefile -/libraries/memtailor/Makefile -/libraries/mathic/Makefile -/libraries/mathicgb/Makefile -/libraries/gtest/Makefile -/libraries/4ti2/Makefile -/libraries/gfan/Makefile -/libraries/fflas_ffpack/Makefile -/libraries/nauty/Makefile -/libraries/cddplus/Makefile -/libraries/lrslib/Makefile -/libraries/cddlib/Makefile -/libraries/glpk/Makefile -/libraries/linbox/Makefile -/libraries/givaro/Makefile -/libraries/fplll/Makefile -/libraries/polymake/Makefile -/libraries/normaliz/Makefile -/libraries/pari/Makefile -/libraries/readline/Makefile -/libraries/ntl/Makefile -/libraries/libtool/Makefile -/libraries/gftables/Makefile -/libraries/factory/Makefile -/libraries/libfac/Makefile -/libraries/frobby/Makefile -/libraries/lapack/Makefile -/libraries/blas/Makefile +/libraries/*/Makefile /Macaulay2/Makefile /Macaulay2/README +/Macaulay2/packages/Makefile /Macaulay2/packages/SCSCP/docinput/Makefile /Macaulay2/book/Makefile /Macaulay2/c/Makefile @@ -131,6 +94,7 @@ /Macaulay2/tests/goals/Makefile /Macaulay2/tests/quarantine/Makefile /Macaulay2/tests/rationality/Makefile +/Macaulay2/tests/threads/Makefile /Macaulay2/util/Makefile /Macaulay2/kernel/Makefile /Macaulay2/kernel/bibasis/Makefile From 250dea46412725115b23da8e1eada79672c724ff Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 18 Oct 2024 17:43:10 -0400 Subject: [PATCH 102/226] Allow running autogen.sh from build directory --- M2/autogen.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/M2/autogen.sh b/M2/autogen.sh index bb2ed3709f5..f7d225dfb59 100755 --- a/M2/autogen.sh +++ b/M2/autogen.sh @@ -2,31 +2,34 @@ set -e +srcdir=$(dirname $0) +test -z "$srcdir" && srcdir=. + echo "-- Generating configure script" -autoreconf --verbose --force --install +autoreconf --verbose --force --install $srcdir # These files may not be created by older versions of autoconf -if test ! -f config.guess +if test ! -f $srcdir/config.guess then - cp -v $(automake --print-libdir)/config.guess . + cp -v $(automake --print-libdir)/config.guess $srcdir fi -if test ! -f config.sub +if test ! -f $srcdir/config.sub then - cp -v $(automake --print-libdir)/config.sub . + cp -v $(automake --print-libdir)/config.sub $srcdir fi -if test ! -f install-sh +if test ! -f $srcdir/install-sh then - cp -v $(automake --print-libdir)/install-sh . + cp -v $(automake --print-libdir)/install-sh $srcdir fi -if test ! -f Macaulay2/editors/emacs/M2.el +if test ! -f $srcdir/Macaulay2/editors/emacs/M2.el then - if test -e ../.git + if test -e $srcdir/../.git then echo "-- Updating M2-emacs submodule" - git submodule update --init Macaulay2/editors/emacs + git submodule update --init $srcdir/Macaulay2/editors/emacs else echo "-- Warning: Not in a git repository; unable to update M2-emacs submodule." echo "-- You may download it from https://github.com/Macaulay2/M2-emacs and extract" From 64265a41bfa33880202ef6429d607f32ca1476ba Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 18 Oct 2024 17:44:37 -0400 Subject: [PATCH 103/226] Update scripts to run autogen.sh from build directory --- .github/workflows/test_build.yml | 2 +- M2/BUILD/docker/rhel/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_build.yml b/.github/workflows/test_build.yml index d3f1698623c..1848401dcaa 100644 --- a/.github/workflows/test_build.yml +++ b/.github/workflows/test_build.yml @@ -154,7 +154,7 @@ jobs: - name: Configure Macaulay2 using Autotools if: matrix.build-system == 'autotools' run: | - pushd ../.. && ./autogen.sh && popd + ../../autogen.sh export PYVERSION=`python3 -c "from sys import version_info; \ print(f'{version_info.major}.{version_info.minor}')"` export CPPFLAGS="-I`brew --prefix`/include -I`brew --prefix libomp`/include" diff --git a/M2/BUILD/docker/rhel/Makefile b/M2/BUILD/docker/rhel/Makefile index 2f21d65d7a2..77c6bec018f 100644 --- a/M2/BUILD/docker/rhel/Makefile +++ b/M2/BUILD/docker/rhel/Makefile @@ -12,9 +12,9 @@ define M2_BUILD_SCRIPT_autotools set -xe git config --global --add safe.directory $(M2_HOME)/M2 -pushd M2/M2 && ./autogen.sh && popd mkdir -p M2/$(BUILD_DIR) cd M2/$(BUILD_DIR) +$(M2_HOME)/M2/M2/autogen.sh $(M2_HOME)/M2/M2/configure --with-system-gc --enable-download make endef From 53f2c947730cd80b4962b3b842bfb5489b0c5968 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sat, 19 Oct 2024 09:10:00 -0400 Subject: [PATCH 104/226] Bump TerraciniLoci package to version 0.2 Add ChangeLog, update copyright years, and add missing "the" in the package description in the copyright header. [ci skip] --- M2/Macaulay2/packages/TerraciniLoci.m2 | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/M2/Macaulay2/packages/TerraciniLoci.m2 b/M2/Macaulay2/packages/TerraciniLoci.m2 index 23c558b28fa..02584b3f93e 100644 --- a/M2/Macaulay2/packages/TerraciniLoci.m2 +++ b/M2/Macaulay2/packages/TerraciniLoci.m2 @@ -1,8 +1,8 @@ --- TerraciniLoci - Macaulay2 package for computing Terracini locus +-- TerraciniLoci - Macaulay2 package for computing the Terracini locus -- of a projective variety --- Copyright (c) 2023 Francesco Galuppi, Pierpaola Santarsiero, Doug Torrance, --- and Ettore Teixeira Turatti +-- Copyright (c) 2023-2024 Francesco Galuppi, Pierpaola Santarsiero, +-- Doug Torrance, and Ettore Teixeira Turatti -- This program is free software; you can redistribute it and/or -- modify it under the terms of the GNU General Public License @@ -31,8 +31,8 @@ newPackage("TerraciniLoci", Headline => "Terracini loci of projective varieties", - Version => "0.1", - Date => "November 16, 2023", + Version => "0.2", + Date => "October 19, 2024", Authors => { { Name => "Francesco Galuppi", @@ -54,6 +54,20 @@ newPackage("TerraciniLoci", "FastMinors", "MinimalPrimes"}) +--------------- +-- ChangeLog -- +--------------- + +-* + +0.2 (2024-10-19, M2 1.24.11) +* stop exporting "Threads" symbol from FastMinors; now exported by Core + +0.1 (2023-11-16, M2 1.23) +* initial release + +*- + export { "terraciniLocus" } From 316b97bbb6635d3cfbbe78a68c7b3007aa2a84db Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sat, 19 Oct 2024 10:33:38 -0400 Subject: [PATCH 105/226] Include bison-generated header files first in html-check-links Otherwise, we may end up including them from elsewhere (e.g., there's a "grammar.h" distributed with some versions of Python). Closes: #2398 --- M2/Macaulay2/html-check-links/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/html-check-links/Makefile.in b/M2/Macaulay2/html-check-links/Makefile.in index 7c3eb98e1bf..692d5b6950a 100644 --- a/M2/Macaulay2/html-check-links/Makefile.in +++ b/M2/Macaulay2/html-check-links/Makefile.in @@ -2,7 +2,7 @@ # FULLDEBUG = TRUE include ../../include/config.Makefile VPATH = @srcdir@ -CPPFLAGS += -I@srcdir@ -I. +CPPFLAGS := -I@srcdir@ -I. $(CPPFLAGS) YACC = @YACC@ %.tab.c %.tab.h: %.y; $(YACC.y) $< && mv y.tab.c $*.tab.c && mv y.tab.h $*.tab.h %.fixed.c : %.tab.c From 639e4115e5d5fa69d9909ccdb2c59c933a1e1151 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 20 Oct 2024 19:31:13 -0400 Subject: [PATCH 106/226] Minimize filename during TestInput test --- M2/Macaulay2/tests/normal/testing.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/tests/normal/testing.m2 b/M2/Macaulay2/tests/normal/testing.m2 index 0a7f557203a..1da90d03bb4 100644 --- a/M2/Macaulay2/tests/normal/testing.m2 +++ b/M2/Macaulay2/tests/normal/testing.m2 @@ -12,7 +12,7 @@ assert Equation(toString pkgtest, "assert Equation(1 + 1, 2)") assert Equation(net pkgtest, "TestInput[" | testpkg | ":3:5-3:32]") beginDocumentation() expectedCode = DIV{ - new FilePosition from (testpkg, 3, 5, 3, 32, 3, 5), + new FilePosition from (minimizeFilename testpkg, 3, 5, 3, 32, 3, 5), ": --source code:", PRE{CODE{"class" => "language-macaulay2", "TEST \"assert Equation(1 + 1, 2)\""}}} From c1a6740e2083404bc4830b4c39a6711e9ba676b5 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 21 Oct 2024 18:59:04 -0400 Subject: [PATCH 107/226] Minimize filename during TestInput tests (take 2) The filename appears in several different checks, so we minimize it at the beginning. --- M2/Macaulay2/tests/normal/testing.m2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/tests/normal/testing.m2 b/M2/Macaulay2/tests/normal/testing.m2 index 1da90d03bb4..df914965db6 100644 --- a/M2/Macaulay2/tests/normal/testing.m2 +++ b/M2/Macaulay2/tests/normal/testing.m2 @@ -1,4 +1,4 @@ -testpkg = temporaryFileName() | ".m2" +testpkg = minimizeFilename(temporaryFileName() | ".m2") testpkg << ///newPackage("TestPackage") beginDocumentation() TEST "assert Equation(1 + 1, 2)" @@ -12,7 +12,7 @@ assert Equation(toString pkgtest, "assert Equation(1 + 1, 2)") assert Equation(net pkgtest, "TestInput[" | testpkg | ":3:5-3:32]") beginDocumentation() expectedCode = DIV{ - new FilePosition from (minimizeFilename testpkg, 3, 5, 3, 32, 3, 5), + new FilePosition from (testpkg, 3, 5, 3, 32, 3, 5), ": --source code:", PRE{CODE{"class" => "language-macaulay2", "TEST \"assert Equation(1 + 1, 2)\""}}} From 7a20108297fe8cb1c0c07a9871963231423630bd Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 20 Oct 2024 18:20:14 -0400 Subject: [PATCH 108/226] Bump ax_boost_base from Autoconf Archive to serial 55 * Adds e2k & loongarch64 to list of lib64 architectures * Fixes typos * Adds /opt/homewbrew to list of search paths * Don't set flags if boost not found --- M2/m4/ax_boost_base.m4 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/M2/m4/ax_boost_base.m4 b/M2/m4/ax_boost_base.m4 index 2ae33f71402..9d5a08c6640 100644 --- a/M2/m4/ax_boost_base.m4 +++ b/M2/m4/ax_boost_base.m4 @@ -10,10 +10,10 @@ # # Test for the Boost C++ libraries of a particular version (or newer) # -# If no path to the installed boost library is given the macro searchs -# under /usr, /usr/local, /opt and /opt/local and evaluates the -# $BOOST_ROOT environment variable. Further documentation is available at -# . +# If no path to the installed boost library is given the macro searches +# under /usr, /usr/local, /opt, /opt/local and /opt/homebrew and evaluates +# the $BOOST_ROOT environment variable. Further documentation is available +# at . # # This macro calls: # @@ -33,7 +33,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 48 +#serial 55 # example boost program (need to pass version) m4_define([_AX_BOOST_BASE_PROGRAM], @@ -114,7 +114,7 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[ AS_CASE([${host_cpu}], [x86_64],[libsubdirs="lib64 libx32 lib lib64"], [mips*64*],[libsubdirs="lib64 lib32 lib lib64"], - [ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64],[libsubdirs="lib64 lib lib64"], + [ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64|e2k|loongarch64],[libsubdirs="lib64 lib lib64"], [libsubdirs="lib"] ) @@ -128,7 +128,7 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[ ) dnl first we check the system location for boost libraries - dnl this location ist chosen if boost libraries are installed with the --layout=system option + dnl this location is chosen if boost libraries are installed with the --layout=system option dnl or if you install boost with RPM AS_IF([test "x$_AX_BOOST_BASE_boost_path" != "x"],[ AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) includes in "$_AX_BOOST_BASE_boost_path/include"]) @@ -151,7 +151,7 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[ else search_libsubdirs="$multiarch_libsubdir $libsubdirs" fi - for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local ; do + for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local /opt/homebrew ; do if test -d "$_AX_BOOST_BASE_boost_path_tmp/include/boost" && test -r "$_AX_BOOST_BASE_boost_path_tmp/include/boost" ; then for libsubdir in $search_libsubdirs ; do if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi @@ -227,7 +227,7 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[ fi else if test "x$cross_compiling" != "xyes" ; then - for _AX_BOOST_BASE_boost_path in /usr /usr/local /opt /opt/local ; do + for _AX_BOOST_BASE_boost_path in /usr /usr/local /opt /opt/local /opt/homebrew ; do if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path" ; then for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do _version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` @@ -289,6 +289,8 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[ else AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).]) fi + BOOST_LDFLAGS="" + BOOST_CPPFLAGS="" # execute ACTION-IF-NOT-FOUND (if present): ifelse([$3], , :, [$3]) else From d6d3ac7b7491d3e38b2ba8de90b1386c9396c005 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 20 Oct 2024 18:24:22 -0400 Subject: [PATCH 109/226] Bump ax_compare_version from Autoconf Archive to serial 13 Fixes typos --- M2/m4/ax_compare_version.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/M2/m4/ax_compare_version.m4 b/M2/m4/ax_compare_version.m4 index 74dc0fdd9a4..ffb4997e8b1 100644 --- a/M2/m4/ax_compare_version.m4 +++ b/M2/m4/ax_compare_version.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html +# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html # =========================================================================== # # SYNOPSIS @@ -79,7 +79,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 11 +#serial 13 dnl ######################################################################### AC_DEFUN([AX_COMPARE_VERSION], [ @@ -146,7 +146,7 @@ x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` ], [.+],[ AC_WARNING( - [illegal OP numeric parameter: $2]) + [invalid OP numeric parameter: $2]) ],[]) # Pad zeros at end of numbers to make same length. @@ -162,7 +162,7 @@ x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` [ne],[ test "x$A" != "x$B" && ax_compare_version=true ],[ - AC_WARNING([illegal OP parameter: $2]) + AC_WARNING([invalid OP parameter: $2]) ]) ]) From ae72e6434f7506b862c6b69d2c7021121b001694 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 20 Oct 2024 18:36:47 -0400 Subject: [PATCH 110/226] Remove ax_func_accept_argtypes from Autoconf Archive We previously had used it to set the SOCKLEN_T macro, but this has been unused since 2021. Remove various references to this and related macros. --- M2/configure.ac | 3 - M2/include/M2/config.h.cmake | 22 ------- M2/m4/ax_func_accept_argtypes.m4 | 99 -------------------------------- 3 files changed, 124 deletions(-) delete mode 100644 M2/m4/ax_func_accept_argtypes.m4 diff --git a/M2/configure.ac b/M2/configure.ac index 353269fe8c8..f276ad7187c 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -12,7 +12,6 @@ AC_SUBST(CONFIG_CMD,"'$0' $ac_configure_args") m4_include(m4/ax_compare_version.m4) m4_include(m4/ax_prog_cc_for_build.m4) -m4_include(m4/ax_func_accept_argtypes.m4) m4_include(m4/relpaths.m4) m4_include(m4/gtest.m4) m4_include(m4/openmp.m4) @@ -374,8 +373,6 @@ AC_CHECK_FUNCS([herror error clock_gettime getaddrinfo hstrerror sync getpgrp se AC_SUBST(HAVE_PERSONALITY,$ac_cv_func_personality) -AC_DEFINE_UNQUOTED(SOCKLEN_T,[`echo "$ac_cv_func_accept_arg3" | sed 's/ \*$//'`],[socket length type used by accept()]) - if test $host_os = mingw32 then CPPFLAGS="$CPPFLAGS -D_POSIX" # arrange for SIGPIPE to get defined CPPFLAGS="$CPPFLAGS -D__USE_MINGW_ALARM" # for SIGALRM to get defined diff --git a/M2/include/M2/config.h.cmake b/M2/include/M2/config.h.cmake index 7a2b7d8b5bf..8668ca07fee 100644 --- a/M2/include/M2/config.h.cmake +++ b/M2/include/M2/config.h.cmake @@ -4,28 +4,6 @@ #ifndef _M2_CONFIG_H #define _M2_CONFIG_H -// TODO: remove the following five? Currently they are hardcoded. -// See https://gist.github.com/stalkerg/7a1e891a887b65823ef9. - -// one of: 'int' 'unsigned int' 'unsigned long long' -/* type of arg 1 of accept() */ -#define ACCEPT_TYPE_ARG1 int - -// one of: 'struct sockaddr *' 'void *' -/* type of arg 2 of accept() */ -#define ACCEPT_TYPE_ARG2 struct sockaddr * - -// one of: 'socklen_t *' 'size_t *' 'unsigned int *' 'int *' -/* type of arg 3 of accept() */ -#define ACCEPT_TYPE_ARG3 socklen_t * - -// one of: 'int' 'unsigned long long' -/* type of return value of accept() */ -#define ACCEPT_TYPE_RETURN int - -/* socket length type used by accept() */ -#define SOCKLEN_T socklen_t - /* machine hardware type */ #define ARCH "${CMAKE_SYSTEM_PROCESSOR}" diff --git a/M2/m4/ax_func_accept_argtypes.m4 b/M2/m4/ax_func_accept_argtypes.m4 deleted file mode 100644 index d30b521f068..00000000000 --- a/M2/m4/ax_func_accept_argtypes.m4 +++ /dev/null @@ -1,99 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_func_accept_argtypes.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_FUNC_ACCEPT_ARGTYPES -# -# DESCRIPTION -# -# Checks the data types of the three arguments to accept(). Results are -# placed into the symbols ACCEPT_TYPE_ARG[123], consistent with the -# following example: -# -# #define ACCEPT_TYPE_ARG1 int -# #define ACCEPT_TYPE_ARG2 struct sockaddr * -# #define ACCEPT_TYPE_ARG3 socklen_t * -# -# This macro requires AC_CHECK_HEADERS to have already verified the -# presence or absence of sys/types.h and sys/socket.h. -# -# NOTE: This is just a modified version of the AC_FUNC_SELECT_ARGTYPES -# macro. Credit for that one goes to David MacKenzie et. al. -# -# LICENSE -# -# Copyright (c) 2008 Daniel Richard G. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 5 - -AU_ALIAS([AC_FUNC_ACCEPT_ARGTYPES], [AX_FUNC_ACCEPT_ARGTYPES]) -AC_DEFUN([AX_FUNC_ACCEPT_ARGTYPES], -[AC_MSG_CHECKING([types of arguments for accept()]) - AC_CACHE_VAL(ac_cv_func_accept_return,dnl - [AC_CACHE_VAL(ac_cv_func_accept_arg1,dnl - [AC_CACHE_VAL(ac_cv_func_accept_arg2,dnl - [AC_CACHE_VAL(ac_cv_func_accept_arg3,dnl - [for ac_cv_func_accept_return in 'int' 'unsigned long long' ; do - for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'unsigned long long'; do - for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'void *'; do - for ac_cv_func_accept_arg3 in 'socklen_t *' 'size_t *' 'unsigned int *' 'int *'; do - AC_TRY_COMPILE(dnl - [#ifdef HAVE_SYS_TYPES_H - #include - #endif - #ifdef HAVE_SYS_SOCKET_H - #include - #endif - #ifdef HAVE_WINSOCK2_H - #include - #endif - extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3);],,dnl - [ac_not_found=no ; break 4], ac_not_found=yes) - done - done - done - done - ])dnl AC_CACHE_VAL - ])dnl AC_CACHE_VAL - ])dnl AC_CACHE_VAL - ])dnl AC_CACHE_VAL - if test "$ac_not_found" = yes; then - AC_MSG_ERROR([test failed]) - ac_cv_func_accept_arg1=int - ac_cv_func_accept_arg2='struct sockaddr *' - ac_cv_func_accept_arg3='socklen_t *' - fi - AC_MSG_RESULT([$ac_cv_func_accept_return accept($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3)]) - AC_DEFINE_UNQUOTED(ACCEPT_TYPE_RETURN,$ac_cv_func_accept_return,[type of return value of accept()]) - AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG1,$ac_cv_func_accept_arg1,[type of arg 1 of accept()]) - AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG2,$ac_cv_func_accept_arg2,[type of arg 2 of accept()]) - AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG3,$ac_cv_func_accept_arg3,[type of arg 3 of accept()]) -]) From d9cc48a4a1ee6cb8de180b53c8415ce69bc8dd2b Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 20 Oct 2024 19:55:04 -0400 Subject: [PATCH 111/226] Remove ax_prog_cc_for_build from the Autoconf Archive Unused since 2021 --- M2/Macaulay2/c/Makefile.in | 6 +- M2/configure.ac | 2 - M2/m4/ax_prog_cc_for_build.m4 | 126 ---------------------------------- 3 files changed, 2 insertions(+), 132 deletions(-) delete mode 100644 M2/m4/ax_prog_cc_for_build.m4 diff --git a/M2/Macaulay2/c/Makefile.in b/M2/Macaulay2/c/Makefile.in index d5bc3b27a1a..abfe79c2eaf 100644 --- a/M2/Macaulay2/c/Makefile.in +++ b/M2/Macaulay2/c/Makefile.in @@ -1,3 +1,5 @@ +# In this directory, we compile "scc1", the D to C translator + # @configure_input@ ############################## main targets ifneq (@ETAGS@,false) @@ -6,10 +8,6 @@ endif all: scc1 scc-core.o include ../../include/config.Makefile -# In this directory, we compile "scc1", the D to C translator, which we want to run -# on the "build" machine, in the sense of autoconf. So we do not want the cross-compiling compiler: -# CC = @ CC_FOR_BUILD @ - top_srcdir = @top_srcdir@ VPATH = @srcdir@ ############################################ diff --git a/M2/configure.ac b/M2/configure.ac index f276ad7187c..5a94a010855 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -11,7 +11,6 @@ AC_DEFINE_UNQUOTED(CONFIG_ARGS,"$C_CONFIG_ARGS",arguments used for configure) AC_SUBST(CONFIG_CMD,"'$0' $ac_configure_args") m4_include(m4/ax_compare_version.m4) -m4_include(m4/ax_prog_cc_for_build.m4) m4_include(m4/relpaths.m4) m4_include(m4/gtest.m4) m4_include(m4/openmp.m4) @@ -1853,7 +1852,6 @@ AC_MSG_NOTICE([using LAPACK_LIBS = $LAPACK_LIBS]) AC_MSG_NOTICE([using LIBS_GDBM = $LIBS_GDBM]) AC_MSG_NOTICE([using LIBS_GLPK = $LIBS_GLPK]) AC_MSG_NOTICE([using LIBS_GMP = $LIBS_GMP]) -AC_MSG_NOTICE([using CC_FOR_BUILD = $CC_FOR_BUILD]) AC_MSG_NOTICE([with ISSUE = $ISSUE]) AC_MSG_NOTICE([with NODENAME = $NODENAME]) AC_MSG_NOTICE([with OS REL = $OS $REL]) diff --git a/M2/m4/ax_prog_cc_for_build.m4 b/M2/m4/ax_prog_cc_for_build.m4 deleted file mode 100644 index 01e4ee5644c..00000000000 --- a/M2/m4/ax_prog_cc_for_build.m4 +++ /dev/null @@ -1,126 +0,0 @@ - - # =========================================================================== - # http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html - # =========================================================================== -dnl -dnl # SYNOPSIS -dnl -dnl # AX_PROG_CC_FOR_BUILD -dnl -dnl # DESCRIPTION -dnl -dnl # This macro searches for a C compiler that generates native executables, -dnl # that is a C compiler that surely is not a cross-compiler. This can be -dnl # useful if you have to generate source code at compile-time like for -dnl # example GCC does. -dnl -dnl # The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything -dnl # needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD). -dnl # The value of these variables can be overridden by the user by specifying -dnl # a compiler with an environment variable (like you do for standard CC). -dnl -dnl # It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object -dnl # file extensions for the build platform, and GCC_FOR_BUILD to `yes' if -dnl # the compiler we found is GCC. All these variables but GCC_FOR_BUILD are -dnl # substituted in the Makefile. -dnl -dnl # LICENSE -dnl -dnl # Copyright (c) 2008 Paolo Bonzini -dnl -dnl # Copying and distribution of this file, with or without modification, are -dnl # permitted in any medium without royalty provided the copyright notice -dnl # and this notice are preserved. This file is offered as-is, without any -dnl # warranty. -dnl -dnl # serial 8 -dnl -AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) -AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_CPP])dnl -AC_REQUIRE([AC_EXEEXT])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl - -dnl Use the standard macros, but make them use other variable names -dnl -pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl -pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl -pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl -pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl -pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl -pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl -pushdef([ac_cv_objext], ac_cv_build_objext)dnl -pushdef([ac_exeext], ac_build_exeext)dnl -pushdef([ac_objext], ac_build_objext)dnl -pushdef([CC], CC_FOR_BUILD)dnl -pushdef([CPP], CPP_FOR_BUILD)dnl -pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl -pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl -pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl -pushdef([host], build)dnl -pushdef([host_alias], build_alias)dnl -pushdef([host_cpu], build_cpu)dnl -pushdef([host_vendor], build_vendor)dnl -pushdef([host_os], build_os)dnl -pushdef([ac_cv_host], ac_cv_build)dnl -pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl -pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl -pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl -pushdef([ac_cv_host_os], ac_cv_build_os)dnl -pushdef([ac_cpp], ac_build_cpp)dnl -pushdef([ac_compile], ac_build_compile)dnl -pushdef([ac_link], ac_build_link)dnl - -save_cross_compiling=$cross_compiling -save_ac_tool_prefix=$ac_tool_prefix -cross_compiling=no -ac_tool_prefix= - -AC_PROG_CC -AC_PROG_CPP -AC_EXEEXT - -ac_tool_prefix=$save_ac_tool_prefix -cross_compiling=$save_cross_compiling - -dnl Restore the old definitions -dnl -popdef([ac_link])dnl -popdef([ac_compile])dnl -popdef([ac_cpp])dnl -popdef([ac_cv_host_os])dnl -popdef([ac_cv_host_vendor])dnl -popdef([ac_cv_host_cpu])dnl -popdef([ac_cv_host_alias])dnl -popdef([ac_cv_host])dnl -popdef([host_os])dnl -popdef([host_vendor])dnl -popdef([host_cpu])dnl -popdef([host_alias])dnl -popdef([host])dnl -popdef([LDFLAGS])dnl -popdef([CPPFLAGS])dnl -popdef([CFLAGS])dnl -popdef([CPP])dnl -popdef([CC])dnl -popdef([ac_objext])dnl -popdef([ac_exeext])dnl -popdef([ac_cv_objext])dnl -popdef([ac_cv_exeext])dnl -popdef([ac_cv_prog_cc_g])dnl -popdef([ac_cv_prog_cc_cross])dnl -popdef([ac_cv_prog_cc_works])dnl -popdef([ac_cv_prog_gcc])dnl -popdef([ac_cv_prog_CPP])dnl - -dnl Finally, set Makefile variables -dnl -BUILD_EXEEXT=$ac_build_exeext -BUILD_OBJEXT=$ac_build_objext -AC_SUBST(BUILD_EXEEXT)dnl -AC_SUBST(BUILD_OBJEXT)dnl -AC_SUBST([CFLAGS_FOR_BUILD])dnl -AC_SUBST([CPPFLAGS_FOR_BUILD])dnl -AC_SUBST([LDFLAGS_FOR_BUILD])dnl -]) From 73a6e6407e7897b87713a34f00636e61c08d0651 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 20 Oct 2024 20:01:12 -0400 Subject: [PATCH 112/226] Update ax_recursive_eval from Autoconf Archive It's now shipped in its own file rather than being included w/ ax_compute_relative_paths. --- M2/configure.ac | 4 +- M2/m4/ax_recursive_eval.m4 | 56 ++++++++++++++ M2/m4/relpaths.m4 | 155 ------------------------------------- 3 files changed, 58 insertions(+), 157 deletions(-) create mode 100644 M2/m4/ax_recursive_eval.m4 delete mode 100644 M2/m4/relpaths.m4 diff --git a/M2/configure.ac b/M2/configure.ac index 5a94a010855..26cf9963039 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -11,7 +11,7 @@ AC_DEFINE_UNQUOTED(CONFIG_ARGS,"$C_CONFIG_ARGS",arguments used for configure) AC_SUBST(CONFIG_CMD,"'$0' $ac_configure_args") m4_include(m4/ax_compare_version.m4) -m4_include(m4/relpaths.m4) +m4_include(m4/ax_recursive_eval.m4) m4_include(m4/gtest.m4) m4_include(m4/openmp.m4) m4_include(m4/search-libraries.m4) @@ -1501,7 +1501,7 @@ else GFTABLESDIR="`$PKG_CONFIG --variable=prefix $FACTORY_NAME`/share/singular/factory/" fi fi - adl_RECURSIVE_EVAL([$GFTABLESDIR], [GFTABLESDIR]) + AX_RECURSIVE_EVAL([$GFTABLESDIR], [GFTABLESDIR]) AC_CHECK_FILE([${GFTABLESDIR}gftables/961],, [AC_MSG_ERROR([could not find gftables but we are not building factory; try specifying the directory with GFTABLESDIR])]) FILE_PREREQS="$FILE_PREREQS ${GFTABLESDIR}gftables/961" diff --git a/M2/m4/ax_recursive_eval.m4 b/M2/m4/ax_recursive_eval.m4 new file mode 100644 index 00000000000..0625aca2255 --- /dev/null +++ b/M2/m4/ax_recursive_eval.m4 @@ -0,0 +1,56 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_recursive_eval.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_RECURSIVE_EVAL(VALUE, RESULT) +# +# DESCRIPTION +# +# Interpolate the VALUE in loop until it doesn't change, and set the +# result to $RESULT. WARNING: It's easy to get an infinite loop with some +# unsane input. +# +# LICENSE +# +# Copyright (c) 2008 Alexandre Duret-Lutz +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 1 + +AC_DEFUN([AX_RECURSIVE_EVAL], +[_lcl_receval="$1" +$2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" + _lcl_receval_old='' + while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do + _lcl_receval_old="[$]_lcl_receval" + eval _lcl_receval="\"[$]_lcl_receval\"" + done + echo "[$]_lcl_receval")`]) diff --git a/M2/m4/relpaths.m4 b/M2/m4/relpaths.m4 deleted file mode 100644 index e9e91a9e989..00000000000 --- a/M2/m4/relpaths.m4 +++ /dev/null @@ -1,155 +0,0 @@ -dnl @synopsis adl_COMPUTE_RELATIVE_PATHS(PATH_LIST) -dnl -dnl PATH_LIST is a space-separated list of colon-separated triplets of -dnl the form 'FROM:TO:RESULT'. This function iterates over these -dnl triplets and set $RESULT to the relative path from $FROM to $TO. -dnl Note that $FROM and $TO needs to be absolute filenames for this -dnl macro to success. -dnl -dnl For instance, -dnl -dnl first=/usr/local/bin -dnl second=/usr/local/share -dnl adl_COMPUTE_RELATIVE_PATHS([first:second:fs second:first:sf]) -dnl # $fs is set to ../share -dnl # $sf is set to ../bin -dnl -dnl $FROM and $TO are both eval'ed recursively and normalized, this -dnl means that you can call this macro with autoconf's dirnames like -dnl `prefix' or `datadir'. For example: -dnl -dnl adl_COMPUTE_RELATIVE_PATHS([bindir:datadir:bin_to_data]) -dnl -dnl adl_COMPUTE_RELATIVE_PATHS should also works with DOS filenames. -dnl -dnl You may want to use this macro in order to make your package -dnl relocatable. Instead of hardcoding $datadir into your programs just -dnl encode $bin_to_data and try to determine $bindir at run-time. -dnl -dnl This macro requires adl_NORMALIZE_PATH. -dnl -dnl @category Misc -dnl @author Alexandre Duret-Lutz -dnl @version 2001-05-25 -dnl @license GPLWithACException - -AC_DEFUN([adl_COMPUTE_RELATIVE_PATHS], -[for _lcl_i in $1; do - _lcl_from=\[$]`echo "[$]_lcl_i" | sed 's,:.*$,,'` - _lcl_to=\[$]`echo "[$]_lcl_i" | sed 's,^[[^:]]*:,,' | sed 's,:[[^:]]*$,,'` - _lcl_result_var=`echo "[$]_lcl_i" | sed 's,^.*:,,'` - adl_RECURSIVE_EVAL([[$]_lcl_from], [_lcl_from]) - adl_RECURSIVE_EVAL([[$]_lcl_to], [_lcl_to]) - _lcl_notation="$_lcl_from$_lcl_to" - adl_NORMALIZE_PATH([_lcl_from],['/']) - adl_NORMALIZE_PATH([_lcl_to],['/']) - adl_COMPUTE_RELATIVE_PATH([_lcl_from], [_lcl_to], [_lcl_result_tmp]) - adl_NORMALIZE_PATH([_lcl_result_tmp],["[$]_lcl_notation"]) - eval $_lcl_result_var='[$]_lcl_result_tmp' -done]) - -## Note: -## ***** -## The following helper macros are too fragile to be used out -## of adl_COMPUTE_RELATIVE_PATHS (mainly because they assume that -## paths are normalized), that's why I'm keeping them in the same file. -## Still, some of them maybe worth to reuse. - -dnl adl_COMPUTE_RELATIVE_PATH(FROM, TO, RESULT) -dnl =========================================== -dnl Compute the relative path to go from $FROM to $TO and set the value -dnl of $RESULT to that value. This function work on raw filenames -dnl (for instead it will considerate /usr//local and /usr/local as -dnl two distinct paths), you should really use adl_COMPUTE_REALTIVE_PATHS -dnl instead to have the paths sanitized automatically. -dnl -dnl For instance: -dnl first_dir=/somewhere/on/my/disk/bin -dnl second_dir=/somewhere/on/another/disk/share -dnl adl_COMPUTE_RELATIVE_PATH(first_dir, second_dir, first_to_second) -dnl will set $first_to_second to '../../../another/disk/share'. -AC_DEFUN([adl_COMPUTE_RELATIVE_PATH], -[adl_COMPUTE_COMMON_PATH([$1], [$2], [_lcl_common_prefix]) -adl_COMPUTE_BACK_PATH([$1], [_lcl_common_prefix], [_lcl_first_rel]) -adl_COMPUTE_SUFFIX_PATH([$2], [_lcl_common_prefix], [_lcl_second_suffix]) -$3="[$]_lcl_first_rel[$]_lcl_second_suffix"]) - -dnl adl_COMPUTE_COMMON_PATH(LEFT, RIGHT, RESULT) -dnl ============================================ -dnl Compute the common path to $LEFT and $RIGHT and set the result to $RESULT. -dnl -dnl For instance: -dnl first_path=/somewhere/on/my/disk/bin -dnl second_path=/somewhere/on/another/disk/share -dnl adl_COMPUTE_COMMON_PATH(first_path, second_path, common_path) -dnl will set $common_path to '/somewhere/on'. -AC_DEFUN([adl_COMPUTE_COMMON_PATH], -[$3='' -_lcl_second_prefix_match='' -while test "[$]_lcl_second_prefix_match" != 0; do - _lcl_first_prefix=`expr "x[$]$1" : "x\([$]$3/*[[^/]]*\)"` - _lcl_second_prefix_match=`expr "x[$]$2" : "x[$]_lcl_first_prefix"` - if test "[$]_lcl_second_prefix_match" != 0; then - if test "[$]_lcl_first_prefix" != "[$]$3"; then - $3="[$]_lcl_first_prefix" - else - _lcl_second_prefix_match=0 - fi - fi -done]) - -dnl adl_COMPUTE_SUFFIX_PATH(PATH, SUBPATH, RESULT) -dnl ============================================== -dnl Substrack $SUBPATH from $PATH, and set the resulting suffix -dnl (or the empty string if $SUBPATH is not a subpath of $PATH) -dnl to $RESULT. -dnl -dnl For instance: -dnl first_path=/somewhere/on/my/disk/bin -dnl second_path=/somewhere/on -dnl adl_COMPUTE_SUFFIX_PATH(first_path, second_path, common_path) -dnl will set $common_path to '/my/disk/bin'. -AC_DEFUN([adl_COMPUTE_SUFFIX_PATH], -[$3=`expr "x[$]$1" : "x[$]$2/*\(.*\)"`]) - -dnl adl_COMPUTE_BACK_PATH(PATH, SUBPATH, RESULT) -dnl ============================================ -dnl Compute the relative path to go from $PATH to $SUBPATH, knowing that -dnl $SUBPATH is a subpath of $PATH (any other words, only repeated '../' -dnl should be needed to move from $PATH to $SUBPATH) and set the value -dnl of $RESULT to that value. If $SUBPATH is not a subpath of PATH, -dnl set $RESULT to the empty string. -dnl -dnl For instance: -dnl first_path=/somewhere/on/my/disk/bin -dnl second_path=/somewhere/on -dnl adl_COMPUTE_BACK_PATH(first_path, second_path, back_path) -dnl will set $back_path to '../../../'. -AC_DEFUN([adl_COMPUTE_BACK_PATH], -[adl_COMPUTE_SUFFIX_PATH([$1], [$2], [_lcl_first_suffix]) -$3='' -_lcl_tmp='xxx' -while test "[$]_lcl_tmp" != ''; do - _lcl_tmp=`expr "x[$]_lcl_first_suffix" : "x[[^/]]*/*\(.*\)"` - if test "[$]_lcl_first_suffix" != ''; then - _lcl_first_suffix="[$]_lcl_tmp" - $3="../[$]$3" - fi -done]) - - -dnl adl_RECURSIVE_EVAL(VALUE, RESULT) -dnl ================================= -dnl Interpolate the VALUE in loop until it doesn't change, -dnl and set the result to $RESULT. -dnl WARNING: It's easy to get an infinite loop with some unsane input. -AC_DEFUN([adl_RECURSIVE_EVAL], -[_lcl_receval="$1" -$2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" - test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" - _lcl_receval_old='' - while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do - _lcl_receval_old="[$]_lcl_receval" - eval _lcl_receval="\"[$]_lcl_receval\"" - done - echo "[$]_lcl_receval")`]) From 0319ea1b40a4ac40731abb9144c5df870233e2d9 Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 09:41:09 -0700 Subject: [PATCH 113/226] adding NumericalSemigroups.m2 --- M2/Macaulay2/packages/NumericalSemigroups.m2 | 3520 ++++++++++++++++++ 1 file changed, 3520 insertions(+) create mode 100644 M2/Macaulay2/packages/NumericalSemigroups.m2 diff --git a/M2/Macaulay2/packages/NumericalSemigroups.m2 b/M2/Macaulay2/packages/NumericalSemigroups.m2 new file mode 100644 index 00000000000..c3dd1dc7f90 --- /dev/null +++ b/M2/Macaulay2/packages/NumericalSemigroups.m2 @@ -0,0 +1,3520 @@ +newPackage( + "NumericalSemigroups", + Version => "0.1", + Date => "March 12, 2024", + Headline => "Compute the Apery set and invariants of a numerical semigroup ring", + Authors => {{ Name => "David Eisenbud", Email => "de@berkeley.edu", HomePage => "eisenbud.github.io"}, + { Name => "Frank-Olaf Schreyer", Email => "schreyer@math.uni-sb.de", HomePage => "https://www.math.uni-sb.de/ag/schreyer/index.php/publications/publications-frank-olaf-schreyer"}}, + AuxiliaryFiles => false, + DebuggingMode => true, + PackageExports => {"FourierMotzkin","Normaliz", "IntegralClosure", "FastMinors", "RandomPoints"} + ) +/// +restart + +loadPackage ("NumericalSemigroups", Reload=>true) +check "NumericalSemigroups" +uninstallPackage "NumericalSemigroups" +restart +installPackage "NumericalSemigroups" + +viewHelp "NumericalSemigroups" +viewHelp Normaliz + +/// +export { + "apery", --done FOS + "aperySet", --done FOS + "semigroup", -- done FOS + "isSymmetric",-- done FOS + "mu", --done + "socle",--done last + "type", -- done + "kunzMatrix", --done FOS + "semigroupIdeal", --done + "semigroupRing", -- FOS: take a look + "aperySemigroupRing", -- done + "gaps", -- done + "isGapSequence", --done + "findSemigroups", --done + "sums", --done + "coneEquations", + "coneRays", + "facetRays", + "allSemigroups", + "def1", --done -- degrees of first order deformations, or the generic first-order deformation itself. + "weight", + "makeUnfolding", -- done + "flatteningRelations", --done + "isSmoothableSemigroup", --done + "ewt", + "effectiveWeight", -- synonym for ewt + "kunzRing",--done FOSthe semigroup ring of R mod the multiplicity element + "burchIndex", --done + "buchweitz", --done + "buchweitzCriterion", --done + "buchweitzSemigroups", --done + "findPoint", --done + "heuristicSmoothness", --done + "knownExample", --done FOS + "isARandomFiberSmooth", --done FOS + "getFlatFamily", --done FOS + "isWeierstrassSemigroup", -- done FOS +-- "estimateTruncationRatio", + "nonWeierstrassSemigroups", -- done FOS + "LabBookProtocol", --done FOS + "fractionalIdeal", --done + } + +-* Code section *- +coneEquations = method(Options => {"Inhomogeneous" => false}) +coneEquations ZZ := Matrix => o -> m -> ( + -- Forms the equations of the homogeneous or inhomogeneous + --Kunz cone for multiplicity m + --the columns are the lexicographically ordered pairs {i,j} + --such that with 1<= i<=j<=m-1 + --i+j != m. + --if o#"Inhomogeneous" == true, then the equations + --for the inhomogeneous Kunz cone are returned + cols := flatten for i from 1 to m-1 list + for j from i to m-1 list {i,j}; + cols = select(cols, p -> sum p != m); + n := #cols; + eqns := map(ZZ^(m-1), ZZ^n, (i,j) -> ( + if (sum cols_j -(i+1)) % m == 0 then -1 else if + cols_j == {i+1,i+1} then 2 else if + isMember(i+1, cols_j) and + cols_j !={i+1,i+1} then 1 else 0)); + if o#"Inhomogeneous" then + eqns || matrix{apply(n, j-> + if sum cols_j < m then 0 else -1)} else + eqns + ) + +coneEquations List := Matrix => o -> L ->( + K := kunzMatrix L; + m := 1 + numrows K; + --get the column indices of E + cols := flatten for i from 1 to m-1 list + for j from i to m-1 list {i,j}; + cols = select(cols, p -> sum p % m !=0); + --find the positions of the cone equations that are satisfied by L + pos := positions(cols, c -> K_(c_0-1, c_1-1) != 0); + coneEquations(m,o)|(-(coneEquations (m, o))_pos) + ) +/// +restart +loadPackage("NumericalSemigroups", Reload => true) +coneEquations(4, "Inhomogeneous" => true) +L = {4,9,14,7} +allSemigroups L +coneEquations(L, "Inhomogeneous" => true) +betti((allSemigroups 5)_1) +/// + +allSemigroups = method() +allSemigroups ZZ := Sequence => m -> ( + -* + Returns a Sequence of two matrices: + The rows of the first form a + Hilbert basis for the homogeneous Kunz cone + of semigroups of multiplicity m, and + a set of module generators for the inhomogeneous + Kunz cone. + *- +ineq := transpose coneEquations m; +cong:=id_(ZZ^(m-1))|(-1)*transpose matrix{toList(1..m-1)}|transpose matrix{toList(m-1:m)}; +trunc:=id_(ZZ^(m-1))|(-1)*transpose matrix{toList(m+1..2*m-1)}; +NL:={(ineq,"inequalities"),(cong, "inhom_congruences"),(trunc,"inhom_inequalities")}; +RatCone:=normaliz NL; +M:=RatCone#"gen"; +pos:=positions(toList(0..rank target M-1),i->M_(i,m-1)==0); +hilbertBasis:=M^pos_{0..m-2}; +pos=positions(toList(0..rank target M-1),i->M_(i,m-1)==1); +moduleGenerators:=M^pos_{0..m-2}; +(hilbertBasis,moduleGenerators) +) + + +allSemigroups List := Sequence => L -> ( +-* Returns a matrix whose rows form a + Hilbert basis for the face containing L + of the homogeneous Kunz cone + of semigroups of multiplicity m; and + a set of module generators for + the corresponding face of the inhomogeneous + Kunz cone. +*- +m:=min L; +ineq0 := coneEquations m; +ap:=matrix{aperySet L}; +pos:=positions(toList(0..rank source ineq0-1),i->(ap*ineq0)_(0,i)==0); +eq:=transpose ineq0_pos; +pos=positions(toList(0..rank source ineq0-1),i->(ap*ineq0)_(0,i)=!=0); +ineq:=transpose ineq0_pos; +cong:=id_(ZZ^(m-1))|(-1)*transpose matrix{toList(1..m-1)}|transpose matrix{toList(m-1:m)}; +trunc:=id_(ZZ^(m-1))|(-1)*transpose matrix{toList(m+1..2*m-1)}; +NL:={(eq, "equations"),(ineq,"inequalities"),(cong, "inhom_congruences"),(trunc,"inhom_inequalities")}; +RatCone:=normaliz NL; +M:=RatCone#"gen"; +pos=positions(toList(0..rank target M-1),i->M_(i,m-1)==0); +hilbertBasis:=M^pos_{0..m-2}; +pos=positions(toList(0..rank target M-1),i->M_(i,m-1)==1); +moduleGenerators:=M^pos_{0..m-2}; +(hilbertBasis,moduleGenerators) +) + +buchweitzCriterion = method() +buchweitzCriterion(List) := L -> ( + G:=gaps L; + 3*(#G-1)-#sums(G,G)) + +buchweitzCriterion(ZZ,List) := (m,L) -> ( + assert(#L==m-1); + buchweitzCriterion(prepend(m,L))) + +/// + +--what succeeded: + + + +restart +loadPackage("NumericalSemigroups", Reload => true) +L = {4,9,14,7} + +(B,G) = allSemigroups 4 +(BL,GL) = allSemigroups L +(B,G) =allSemigroups {4,5} +L={6,8,10,13} +mingens L +elapsedTime (H,M)=allSemigroups L +aperySet L==first entries H+first entries M +L={10,13,15,16,18}, type L +elapsedTime (H,M)=allSemigroups L +tally flatten apply(entries M,L->buchweitzCriterion (10,L)) +tally flatten apply(entries M,L->apply(entries H,h->buchweitzCriterion(10,L+h))) + + +L=buchweitz 0 +elapsedTime (H,M)=allSemigroups L +betti H, betti M +H +showNmzOptions() +elapsedTime (H,M)=allSemigroups 8; +betti H, betti M + +i14 : elapsedTime (H,M)=allSemigroups 9; +betti H, betti M +-* +m=9 +elapsedTime (H,M)=allSemigroups m; +betti H, betti M +-- 268.992 seconds elapsed + +i15 : + 0 1 0 1 +o15 = (total: 6943 8, total: 35886 8) + -1: . 8 -1: . 8 + 0: 6943 . 0: 35886 . + + +elapsedTime tally flatten apply(entries M,L->buchweitzCriterion (L)) + + -- 43.7384 seconds elapsed + +o16 = Tally{0 => 3093} + 1 => 3803 + 2 => 4864 + 3 => 5310 + 4 => 5211 + 5 => 3852 + 6 => 3575 + 7 => 2474 + 8 => 1517 + 9 => 1086 + 10 => 575 + 11 => 308 + 12 => 150 + 13 => 42 + 14 => 21 + 15 => 3 + 16 => 2 + + + +*- +elapsedTime tally flatten apply(entries M,L->buchweitzCriterion (m,L)) +tally flatten apply(entries M,L->apply(entries H,h->buchweitzCriterion (m,L+h))) + + + +elapsedTime LB=buchweitzSemigroups(13,17)|buchweitzSemigroups(14,17) +buchweitzSemigroups(15,17) +flatten apply(LB,L->buchweitzCriterion (L)) +netList apply(LB,L->((H,M)=allSemigroups L;tally flatten apply(entries H,g-> + apply(entries M,b->buchweitzCriterion(min L,b+g))))) +netList apply(LB,L->((H,M)=allSemigroups L;(L,M^{0}))) +b=toList(14..25) +netList apply(LB_{0..3},L->((H,M)=allSemigroups L; g= first entries H;apply(16,i->genus({13}|(b+i*g))))) +netList apply(LB_{0..3},L->((H,M)=allSemigroups L; g= first entries H;apply(16,i->buchweitzCriterion(13,b+i*g)))) + + +b=toList(15..27) +apply(LB_{4..5},L->((H,M)=allSemigroups L; g= first entries H;apply(16,i->buchweitzCriterion(14,b+i*g)))) + +elapsedTime LB=buchweitzSemigroups(12,18) +elapsedTime LB=buchweitzSemigroups(13,18) -- 47.2556 seconds elapsed +elapsedTime LB=buchweitzSemigroups(14,18) -- 14.8381 seconds elapsed +elapsedTime LB=buchweitzSemigroups(15,18) -- 4.35668 seconds elapsed +elapsedTime LB=buchweitzSemigroups(16,18)=={} -- 1.19864 seconds elapsed + +elapsedTime LB=buchweitzSemigroups(16,19) +netList +N=matrix apply(LB_{0},L->((H,M)=allSemigroups L; (g= first entries H//16))) +fourierMotzkin transpose N +viewHelp "fourierMotzkin" + +restart +debug loadPackage("NumericalSemigroups", Reload => true) + +/// + +facetRays=method() +facetRays(List) := L -> ( + L1:=if L_0==0 then drop(L,1) else L; + A:=apery L1; + m:=A#"multiplicity"; + halfSpaces := coneEquations m; + a:=matrix{aperySet A}; + eqpos:=positions(toList(0..rank source halfSpaces-1),i->(a*halfSpaces)_{i}==0); + linEq:=halfSpaces_eqpos; + halfFacet:=halfSpaces%linEq; + fRays:=-(fourierMotzkin(halfFacet,linEq))_0; + fRays + ) + +coneRays = method() +coneRays ZZ := Matrix => m -> -(fourierMotzkin coneEquations m)_0 + + +findSemigroups = method() +findSemigroups(ZZ,ZZ,ZZ) := (m,c,g) ->( + --list all semigroups with multiplicity m, conductor c, and precisely g gaps + if g gc+set(1..m-1)+set{c-1}); + for G in GG list ( + s := isGapSequence(toList G); + if class s === List and gcd s == 1 then( + mingens unique (s|apply(m, i->c+i))) else continue) +) + +findSemigroups (ZZ,ZZ) := (m,g) -> ( + --list all semigroups of multiplicity m with g gaps. + L := {}; + for c from m to 2*g do( +-- <<"c = "< ( + --list all semigroups with g gaps. + L := {}; + for m from 2 to g+1 do ( + for c from m to 2*g do( + if (c-1)%m !=0 then ( + ell := findSemigroups(m,c,g); + if ell !={} then L = L |ell))); + L + ) + +/// +findSemigroups(3,8,4) == {{3,5}} +findSemigroups(5,14,8) == {{5,7,9}, {5, 9, 11, 12}} +findSemigroups(5,14,8) +assert(findSemigroups(3,8,4) == {{3,5}}) +assert(findSemigroups(5,14,8) == { + {5, 7, 11}, + {5, 7, 9}, + {5, 6, 14}, + {5, 9, 11, 12}}) + +m = 12 +elapsedTime ss = findSemigroups(m,17); +for L in ss list (if #sums(2,L)> 3*17-3 then L else continue) +/// + +/// +loadPackage( "NumericalSemigroups", Reload => true) +elapsedTime ss = findSemigroups 17; +#ss +elapsedTime bss = for L in ss list ( + G = gaps L; + g = #G; + if #sums(2,G) > 2*(2*g-2)-g+1 or + #sums(3,G) > 3*(2*g-2)-g+1 or + #sums(4,G) > 4*(2*g-2)-g+1 then L else continue) + + netList apply(bss, L -> (LA = aperySet L; + m := min L; + apply(#LA, i -> (LA_i-i-1)//min L)) +) +L = {1,3} +sums(L,L) +sums(2,L) +/// + +isGapSequence = method() +isGapSequence List := List => G'-> ( + --if the complement in the integers defines a semigroup s then return s; else + --return false + G := sort G'; + c := 1+ max G; + s := select(c+1, i ->i>0 and not isMember(i, G)); + m := min s; + s = s|apply(m-1,i->c+i+1); + if G == gaps (L := mingens s) then L else false + ) + +/// +restart +debug loadPackage("NumericalSemigroups", Reload => true) +ss = for g from 3 to 16 list elapsedTime findSemigroups g; +#flatten ss +ssplus = for g from 3 to 16 list ({g}|ss_(g-3)); + +g = ssplus_1_0 +sg = drop(ssplus_1,1) +elapsedTime sse = for s in flatten ss list( + t := false; + g = #gaps s; + for n from 2 to 4 list( + if #sums(n, gaps s)>n*(2*g-2)-g+1 then t = true); + if t == true then s else continue); #sse + + for n from 2 to 4 list + #sums(n, gaps s)>(2*(n+1)-1)*(g-1) + + (2*nxzz1)-1)*(g-1) +n = 4 + +s = first oo +n = 3 +#sums(n,gaps s) +(2*n-1)*(g-1) + +weight toList(g+1..2*g+1) +gaps toList(g+1..2*g+1) + +/// + + +gaps = method() +gaps List := List => L -> ( + --list of gaps in the semigroup generated by L + A := apery L; + c := A#"conductor"; + s := A#"semigroup"; + m := min L; + select(c, i -> not isMember(i, s)) + ) + +/// +restart +loadPackage("NumericalSemigroups", Reload => true) +g = 7 +weight toList(g+1..2*g+1) +gaps toList(g+1..2*g+1) +/// + +weight = method() +weight List := L ->( + G := sort gaps L; + sum apply (#G, i -> G_i-1 - i) + ) + +sums = method() +--sums List := L -> sort unique flatten apply(L, i-> apply(L, j-> i+j)) +sums (List, List) := (L,L') -> sort unique flatten apply(L, i-> apply(L', j-> i+j)) + +sums (ZZ,List) := (n,L) ->( + L' := L; + for i from 1 to n-1 do (L' = flatten apply(L', j -> apply(L, k -> j+k))); + sort unique L') + + +apery = method() +apery List := HashTable => L -> ( + --require gcd = 1; + if gcd L != 1 then error"requires relatively prime generating set"; + A := new MutableHashTable; + --A will hold the apery set, and a few invariants of the semigroup derived along the way + m := min L; -- the multiplicity + a := 0; -- number of keys already filled in A + S := set L + set{0}; -- S will hold all the semigroup elmeents found, including 0 + + --now look for new Apery set elememts and semigroup elements until + --all the keys have been filled. + s := m; + while a < m-1 do( + s = s+1; + t := any(L, u -> isMember(s-u, S)); + if t then ( + S = S + set {s}; + s' := s % m; + if not A#?s' and not s'== 0 then ( + A#s' = s; + a = a+1) + ) + ); + + A#"multiplicity" = m; + A#"semigroup" = sort toList S; + A#"conductor" = max A#"semigroup" - m +1; + hashTable pairs A + ) + +aperySet = method() +aperySet HashTable := List => A -> ( + K := select(keys A , k-> class k === ZZ); + apply(sort K, k -> A#k) + ) +aperySet List := L -> aperySet apery L + +semigroup = method() +semigroup List := List => L -> (apery L)#"semigroup" + +--conductor = method() +conductor List := ZZ => L -> (apery L)#"conductor" + +isSymmetric = method() +isSymmetric List := Boolean => L -> ( + A := apery L; + m := A#"multiplicity"; + c := A#"conductor"; + sgrp := #A#"semigroup"; + c == 2*(sgrp - m) + ) + +mu = method() +mu List :=List => L -> ( + As := aperySet L; + m := min L; + for i from 0 to m-2 list (As_(i) - (i+1))//m + ) +mu HashTable := List => H -> ( + --H should be apery L + As := aperySet H; + m := H#"multiplicity"; + for i from 0 to m-2 list (As_(i) - (i+1))//m + ) +--genus = method() +genus List := ZZ => L -> sum mu L +--number of gaps + +positiveResidue = (p,q) -> if p<0 then p + (1+abs p//q)*q else p%q -- assumes q>0 +--needs a version where c is known. +--mingensSemigroup = method() +--mingensSemigroup List := s -> ( +mingens List := List => o-> s ->( --note that mingens, defined in the system, has options, so the o -> is necessary + s' := select (s, a -> a != 0); + g := gcd s'; + if g != 1 then s' = apply(s', a -> a//g); + m := min s'; + s' = aperySet s'; + out :={}; + for i from 1 to m-1 do + for j from 1 to m-1 do ( + a := s'_(i-1); + b := s'_(j-1); + if a<=b then continue; + if a-b >= s'_(positiveResidue(i-j-1 , m)) then out = out | {i-1} + ); + sort ({m}|toList (set s' - set(s'_out))) + ) + +/// +restart +loadPackage"NumericalSemigroups" +s = semigroup {3,7} +mingens s + +s={8, 10, 31, 129, 130} +mingens s +/// +socle = method() +socle List := List => L' -> ( + L := mingens L'; + A := apery L; + K := select(keys A , k-> class k === ZZ); + aS := apply(sort K, k -> A#k); -- the Apery set + m := A#"multiplicity"; + select(aS, a -> all(L, ell -> + not isMember(a+ell, aS))) + ) + +/// +restart +loadPackage( "NumericalSemigroups", Reload => true) +L = {1,3} +sums(L,L) +sums(3,L) +isGapSequence(G = {1, 2, 4, 7}) +G ={1, 2, 8, 11} +elapsedTime isGapSequence G +/// + + + +eMatrix = L ->( + A := apery L; + m := A#"multiplicity"; + map(ZZ^(m-1), ZZ^(m-1), (i,j) -> if i+j+2 == m then 0 else A#(i+1)+A#(j+1)-A#((i+j+2)%m)) + ) + + +kunzMatrix = method() +kunzMatrix HashTable := Matrix => A -> ( + m := A#"multiplicity"; + map(ZZ^(m-1), ZZ^(m-1), (i,j) -> ( + if i+j+2 == m then 0 else ( + a := A#(i+1)+A#(j+1)-A#((i+j+2)%m); + if a == 0 then 1 else 0) + ))) + +kunzMatrix List := Matrix => L -> kunzMatrix apery L + +type = method() +type List := ZZ => L -> #socle L + +semigroupRing = method(Options => {"BaseField" => ZZ/101, + "VariableName" => getSymbol "x", + "MinimalGenerators" => true}) + +semigroupRing List := Ring => o-> L -> ( + I := semigroupIdeal(L,o); + R := (ring I)/I; + R.cache#"sgrp" = L; + R + ) +semigroupIdeal = method(Options => {"BaseField" => ZZ/(nextPrime 10^3), + "VariableName" => getSymbol "x", + "MinimalGenerators" => true}) +semigroupIdeal List := Ideal => o -> L -> ( + --Here the variables correspond to the given semigroup generators. + if o#"MinimalGenerators" == true then L':= mingens L else L' = L; + m := min L'; + --t := #L; + x := o#"VariableName"; + kk := o#"BaseField"; + R := kk[apply(L',i-> x_(i%m)),Degrees => L']; + t := symbol t; + R1 := kk[t]; + I := trim ker map(R1, R, apply(L', i -> t^i)); + I.cache#"sgrp" = L; + I + ) + + +/// +restart +loadPackage("NumericalSemigroups", Reload => true) +LL = {{3,5},{3,4,5},{3,4}} +L={4,5} +assert all(LL, L -> transpose facetRays L * coneEquations L == 0) +LL = {{3,5},{3,4,5},{3,4}} +assert all(LL, L -> transpose coneEquations L * facetRays L == 0) +netList apply(LL,L->ideal semigroupRing(L,symbol u)) +netList apply(LL,L->ideal semigroupRing(L)) + +semigroupIdeal({3,4,5,6}, "VariableName"=> z, "BaseField" => ZZ/3, "MinimalGenerators"=>false) +ideal(z_0^5-z_1^4) == semigroupIdeal({4,5}, "VariableName"=> z, "BaseField" => ZZ/3, "MinimalGenerators"=>false) +/// +aperySemigroupRing=method() +aperySemigroupRing List := L -> ( + A:=apery L; + m:= A#"multiplicity"; + degs1 := apply(toList(1..m-1),i-> A#i); + kk:= ZZ/101; + x := symbol x; + S1:=kk[x_0..x_(m-1),Degrees=>prepend(m,degs1)]; + t:= symbol t; + T:= kk[t]; + phi :=map(T,S1,matrix {apply(m,i->t^((degree x_i)_0))}); + I1 := ker phi; + xs:=drop(sort(gens S1,y->degree y),1)|{x_0}; + S:=kk[xs, Degrees=>apply(xs,y->(degree y)_0)]; + I:=sub(I1,S); + xs2:=flatten apply(m-1,i->apply(toList(i..m-2),j->S_i*S_j)); + xs2r:=apply(xs2,yy->yy%I); + R := S/ideal(xs2-xs2r); + R.cache#"sgrp" = L; + R + ) +semigroupFromAperySet=method() +semigroupFromAperySet(List) := List => As -> ( + -- As := aperySet L; + m:=#As+1; + L:=prepend(m,As); + semigroup L) + + + + +-* +fix:we want to apply this to a basis of Hom(I/I^2, S^1/I)/Hom(Omega, S^1/I), not to the generators of +Hom(I/I^2, S/I). + +In the case L = {3,4,5} the basis has 3 elements; Hom(I/I^2, S/I) has 6 generators, isn't even 0-dimensional. +The deformation was NOT flat before factoring out (t)^2. +*- + +def1 = method(Options => {"BaseField" => ZZ/101,"JustDegs" => true})--, "BaseField"}) +def1 List := o -> L -> ( + --degrees of first-order deformations or the generic first-order deformation itself. + B := semigroupRing (L, "BaseField" => o#"BaseField"); + I := ideal B; + S := ring I; + H := Hom(module I, S^1/I); + H' := Hom(S^(-L), S^1/I); + Dmat := diff( transpose vars S, gens I); + D := map(S^(-L),module I/I^2, Dmat); + DI := map(S^(-L),module I, Dmat); + t1module := coker map(H,H',Hom(DI, id_(S^1/I))); + pt1 := prune t1module; + pmap := (pt1.cache.pruningMap)^(-1); + surj := pmap*inducedMap (t1module, H); + bt1 := basis pt1//surj; + if o#"JustDegs" == true then return (flatten sort degrees source bt1); +--Default: execution ends here. The rest can be slow, already for multiplicity 5. + + h := rank source bt1; + homs := apply(h, i-> homomorphism bt1_{i}); + degs := -(homs/degree)|(gens S/degree); + t := symbol t; + T := coefficientRing S[t_0..t_(h-1),gens S, Degrees => degs]; + Tbar := T/(ideal(t_0..t_(h-1)))^2; + II := sub(gens I, Tbar) +sum(h, i-> Tbar_i*(map(Tbar^1, , sub(matrix homs_i, Tbar)))); + ideal(Tbar**II) + --(h, betti res coker gens I, betti res coker (Tbar** II)) + ) + +t2 = method(Options => {"BaseField" => ZZ/101}) +t2 List := o -> L -> ( + B := semigroupRing (L, "BaseField" => o#"BaseField"); + I := ideal B; + S := ring I; + prune Ext^1(I, S^1/I) + ) + + +/// +restart +loadPackage ("NumericalSemigroups", Reload => true) +L = {2,3} +L = {3,4,5} +L = {5,7,11} +apery L +def1 L +B = semigroupRing L +def1 L +--Buchweitz' example +G=toList(1..12)|{19,21,24,25} +L=isGapSequence G +B = semigroupRing L +type L +S = ambient B +I = ideal B +res I +def1 L +apery L +/// + +/// +restart +debug loadPackage("NumericalSemigroups", Reload => true) +G={1,2,3,5,6} +L=isGapSequence G +gaps L +--L = {3,5} +sum L +gaps L +R = semigroupRing (L,"a") +ideal R +I = semigroupIdeal L +isHomogeneous I +betti (F= res I) +F.dd +L = {3,4,5} +--eMatrix L +kunzMatrix L +kunzMatrix{3,5} +kunzMatrix{3,5,7} +type L +apery L +L = {3,7} +L = {27,35} + +L = {7,8,9} +socle L +A = apery L +aperySet A +isSymmetric L +mu L +genus L +mingens L + +(i,j) = (1,1) +aS_(i-1)+aS_(j-1) aS_((i+j)%m-1) +(i,j) = (0,0) +A#(i+1)+A#(j+1)-A#((i+j)%m+1) + +/// + +makeUnfolding=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) + +makeUnfolding Ideal := o-> I ->( + if not degreeLength ring I == 1 or + not isHomogeneous I or + I != trim I then + error "expected N-graded homogeneous ideal + given with minimal set of generators"; +-- gbI := gb(I,ChangeMatrix =>true); +-- chMat := getChangeMatrix gbI; + S := ring I; + kk := coefficientRing S; + degs := flatten degrees source gens I; + unfoldingTerms := flatten for i from 0 to max degs-1 list (b:=basis(i,S/I); if b==0 then + continue else (entries b))_0; + unfoldingTerms2 := apply(degs,d->select(unfoldingTerms, t-> (degree t)_0 < d)); + a := symbol a; + avars := flatten apply(#degs,i->apply(#unfoldingTerms2_i,j->a_{i,j})); + adegs := flatten apply(#degs,i->apply(unfoldingTerms2_i,t->degs_i-(degree t)_0)); + A := kk[avars,Degrees=>adegs]; + avars= reverse sort(gens A,y->degree y); + adegs=apply(avars,y->(degree y)_0); + A = kk[avars,Degrees=>adegs]; + SA := kk[gens S|gens A,Degrees=>degrees S|degrees A]; + avars = apply (#degs,i->apply(#unfoldingTerms2_i,j->a_{i,j})); + unfoldingTerms3 := matrix{apply(#degs,i->sum(#unfoldingTerms2_i,j-> + sub(a_{i,j},SA)*sub((unfoldingTerms2_i)_j,SA)))}; + unfolding := sub(gens I,SA)+unfoldingTerms3; + (A,unfolding) + ) + +makeUnfolding List := o-> L -> ( + I:= trim ideal semigroupRing(L,"BaseField"=>o#"BaseField"); + makeUnfolding I) + + +-* +flatteningRelations1=method() +flatteningRelations1(Ideal,Ring, Matrix) := (I,A,unfolding) -> ( + gbI:=gb(I,ChangeMatrix=>true); + S := ring I; + SA := ring unfolding; + chMat:=getChangeMatrix gbI; + unfoldingGB := unfolding*sub(chMat,SA); + ldT := flatten entries leadTerm unfoldingGB; + s0:=syz sub(gens gbI,SA);s1:=null; + --Now we compute the Buchberger test syzygies + us:=null;testSyzygy1:=null;u1:=null; + while ( + testSyzygy1=unfoldingGB*s0; + us=apply(ldT,u->(u1=contract(u,testSyzygy1); + testSyzygy1=testSyzygy1-u*u1; + u1)); + s1=fold(us,{i,j}->i||j); + not s1 == 0 ) do ( + s0 = s0-s1); + --The flatteningRelations are the coefficients of testSyzygy2 + testSyzygy2:=unfoldingGB*s0; + ma := max flatten degrees source syz leadTerm gens gbI; + rems := reverse flatten for i from 0 to ma list (b:=basis(i,S^1/I); if b==0 then continue else (entries b))_0; + us = apply(rems,u->(u1:=contract(sub(u,SA),testSyzygy2);testSyzygy2-sub(u,SA)*u1; + u1)); + relsA:=sub(ideal(flatten us),A); + relsA + ) +*- + +flatteningRelations=method() +flatteningRelations(Ideal,Ring, Matrix) := (I,A,unfolding) -> ( + gbI:=gb(I,ChangeMatrix=>true); + S := ring I; + SA := ring unfolding; + chMat:=getChangeMatrix gbI; + unfoldingGB := unfolding*sub(chMat,SA); + -- can one use the build in gb algorithm to copute the + -- flattening relations faster + unfGBf:=forceGB unfoldingGB; + ldT := flatten entries leadTerm unfoldingGB; + s0:=syz sub(gens gbI,SA); + testSyzygy1:=unfoldingGB*s0; + testSyzygy2:=testSyzygy1%unfGBf; + u1:=null; + ma := max flatten degrees source syz leadTerm gens gbI; + rems := reverse flatten for i from 0 to ma list (b:=basis(i,S^1/I); if b==0 then continue else (entries b))_0; + us := apply(rems,u->(u1=contract(sub(u,SA),testSyzygy2);testSyzygy2-sub(u,SA)*u1; + u1)); + relsA:=sub(ideal(flatten us),A); + relsA + ) + + + + +isSmoothableSemigroup=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) + +isSmoothableSemigroup(List,RR,ZZ) := o-> (L,r,n) -> ( + (I,J1,family) := getFlatFamily(L,r,n,o); + isARandomFiberSmooth(I,J1,family,o)) + + +ewt=method() +ewt(List):= L -> ( + G:=gaps L; + L1:=mingens L; + sum(L1,a->#select(G,b->a ewt sgrp + +findPoint=method(Options => {Verbose => false}) + +findPoint(Ideal) := o -> (c) -> ( + c1 := prune c; + R := ring c; + A1 := vars R % c; + if c1==0 then return sub(A1,random(R^1,R^(numgens R))); + if o.Verbose then << "has to solve" <false),kk);) else ( + point = sub(matrix randomPoints(cR1,Homogeneous=>false),kk)); + subs1:=apply(#leftOverVars,i->leftOverVars_i => point_(0,i)); + assert(sub(cR1,subs1)==0); + --ring c === ring A1; + A2:=sub(sub(A1,subs1),R); + return sub(A2,random(R^1,R^(numgens R))); + ) + + + + +getFlatFamily=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) + +getFlatFamily(List,RR,ZZ) := o -> (L,r,n) -> ( + I := semigroupIdeal(L, "BaseField"=> o#"BaseField"); + if o.Verbose then ( + degsT1:=-def1 L; + << "unfolding" <(degree aa)_0<=ma*r+n); + runfolding:=unfolding%sub(restrict,SA); + if o.Verbose then ( + <<"flatteningRelations"<mA);) else ( + gbJ=forceGB gens gb(J,DegreeLimit=>mA);); + varsAmodJ:=vars A%gbJ; + J1:=sub(J,varsAmodJ); + family:=sub(runfolding,sub(vars S,SA)|sub(varsAmodJ,SA)); + if J1==0 then assert (betti syz family==betti syz gens I); + (I,J1,family)) + +isWeierstrassSemigroup=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) + +isWeierstrassSemigroup(List,RR) := o -> (L,r) -> ( + if o.Verbose then (elapsedTime degT1:=def1(L);) else degT1=def1(L); + truncations:=-unique select(degT1,d->d<0); + I:=semigroupIdeal L; + S:=ring I; + (A,unfolding):=makeUnfolding I; + ma:=max flatten (gens A/degree); + truncations=select(truncations,d->d ( + I:=null;S:=null;A:=null;unfolding:=null; + J1:=null; family:= null;ratio:=null;degT1:=null; + truncations:=null;ma:=null;t:=null;answer:=null; + ratios:=apply(LL,L -> ( + <d<0); + I=semigroupIdeal L; + S=ring I; + (A,unfolding)=makeUnfolding I; + ma=max flatten degrees A; + for t in truncations do ( + elapsedTime (<true) +L={6, 9, 14, 19, 22} +genus L + +apply(LL,L->(I=semigroupIdeal L; (A,unfolding)=makeUnfolding I; + mA= max flatten degrees A;degT1=-def1 L;(ma,max degT1))) + + + +elapsedTime isWeierstrassSemigroup L + + + +J1==0 +J1 +SA=ring family +ffam=res ideal family +ffam.dd_4 +isSmoothableSemigroup(L,0.2,0) +/// + +isARandomFiberSmooth=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) +isARandomFiberSmooth(Ideal,Ideal,Matrix) := o -> (I,J1,family) -> ( + S := ring I; + A := ring J1; + fib:=null;answer:= null; + if J1==0 then (fib = ideal sub(family,vars S|random(S^1,S^(numgens A))); + answer = heuristicSmoothness(fib); + if o.Verbose then <ideal map(A^1,,gens sub(c,matrix{ varsJ1}))); +*- + if o.Verbose then (<<"decompose" <( + A2=findPoint(c); + --point=sub(sub(h,A2),coefficientRing A); + point=sub(A2,coefficientRing A); + assert( + sub(J1,point)==0); + fib=ideal sub(family,vars S|point); + ---break return fib; + --assert(betti syz gens fib == betti syz gens I); + answer = heuristicSmoothness(fib); + -- singF=radical ideal gens gb (fib +minors(#mingens L-1,jacobian fib)); + if answer then -1 else 0 + --dim singF + )); + if o.Verbose then ( + << "support c, codim c: " <(#support c,codim c)) < + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) +heuristicSmoothness(Ideal) := o -> fib -> ( + --VerifyNonRegular:= null; + --regularInCodimension(1, (ring fib)/fib, VerifyNonRegular=>true, Verbose=>true) ) + jac := jacobian fib; + kk:=coefficientRing ring fib; + R1:=kk[support fib]; + points:= fib;N:=1; + numberOfSingPoints:=null;dimPoints:=null; + rad:=null;someMinors:=null; + while ( + someMinors = chooseGoodMinors(20*N,numgens ring fib-1,jac); + points = ideal gens gb (points+someMinors); + dimPoints=dim points; + if dimPoints>-1 then ( + rad = radical points; + numberOfSingPoints=degree sub(rad,R1);); + dimPoints>-1 and numberOfSingPoints>1 and N<2) do (N=N+1); + if dimPoints==-1 then return true; + jacpt:=sub(jac,vars ring fib%rad); + if numberOfSingPoints==1 then ( + return rank jacpt==codim fib) else ( + if o.Verbose then ( + <<"numberOfSingPoints "< ( + if #L<=3 then return true;--determinantal + if #L == 4 and type L == 1 then return true;--pfaffian + --if L is a generalized Arithmeti cProgression L + --then in some cases the paper of Oneto and Tamone shows smoothness + g := genus L; + if ewt L < g or min L <5 then return true else false) + +nonWeierstrassSemigroups=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) +nonWeierstrassSemigroups(ZZ,ZZ) := o -> (m,g) -> ( + LL:= findSemigroups(m,g); + LLa:=select(LL,L->not knownExample L); + if o.Verbose then <<(#LL,#LLa) < ( + if o.Verbose then (<6 ) do (r=r-0.05;if o.Verbose then (<<#LLa<(if o.Verbose then (< (m,g,LLdifficult) -> ( + LL:= findSemigroups(m,g); + LLa:=sort select(LL,L->not knownExample L); + <<(#LL,#LLa) <not isMember(L,LLdifficult)); + r:=0.6; + while ( elapsedTime LLa=select(LLa,L-> (<6 ) do (r=r-0.1); + <(< L -> ( + I := ideal kunzRing L; + mm := ideal vars ring I; + BI := (mm*I):(I:mm); + numcols basis (mm/(BI)) + ) +/// +restart +loadPackage("NumericalSemigroups", Reload => true) +L = {3,4,5} +isHomogeneous kunzRing L +burchIndex {3,4,5} + +/// +kunzRing = method() +kunzRing List := Ring => L -> ( + --returns the semigroup ring of R mod the multiplicity element + R := semigroupRing L; + m := min(gens R/degree); + newvars := select(gens R, x -> degree x > m); + newdegs := select(gens R/degree, d -> d>m); + S := coefficientRing R[newvars, Degrees => newdegs]; + S/trim sub(ideal R, S) + ) + +buchweitz = method() +buchweitz ZZ := List => i -> ( + --for i>=0 this produces a semigroup B with genus 16+i, conductor 26+2i, and + --#sums(2, gaps buchweitz i) = 3*(genus B -1)+1) + G := toList(1..12+i)| {19+2*i, 21+2*i, 24+2*i, 25+2*i}; + isGapSequence G) + +buchweitzSemigroups = method() +buchweitzSemigroups (ZZ, ZZ, ZZ) := (m,c,g) ->( + LL := findSemigroups(m,c,g); + if #LL !=0 then ( + LB := select(LL, L -> ( + G := gaps L; + #sums(G,G) > 3*(#G -1))); + --if #LB >0 then + -- (<( + LL := findSemigroups(m,g); + if #LL !=0 then ( + LB := select(LL, L -> ( + G := gaps L; + #sums(G,G) > 3*(#G -1))); + --if #LB >0 then + -- (<( + LL := findSemigroups g; + if #LL !=0 then ( + LB := select(LL, L -> ( + G := gaps L; + #sums(G,G) > 3*(#G -1))); + --if #LB >0 then + -- (< g ->( + + if g == 7 then print(" + LL7=findSemigroups 7;#LL7 + LL7a=select(LL7,L->not knownExample L);#LL7a + elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0)) + LL7b=={} -- => every genus 7 semigroup is Weierstrass + "); + + if g == 8 then print(" + LL8=findSemigroups 8;#LL8 + LL8a=select(LL8,L->not knownExample L);#LL8a + elapsedTime LL8b=select(LL8a,L-> not isSmoothableSemigroup(L,0.40,0)) -- 16.7345 seconds elapsed + LL8b=={{6,8,9,11}} + elapsedTime LL8c=select(LL8b,L-> not isWeierstrassSemigroup(L,0.15)) -- 1.88664 seconds elapsed + LL8c=={} -- => every genus 8 semigroup is Weierstrass + "); + + if g == 9 then print(" + LL9=findSemigroups 9;#LL9 + LL9a=select(LL9,L->not knownExample L);#LL9a + elapsedTime LL9b=select(LL9a,L->(not isSmoothableSemigroup(L,0.5,0)));#LL9b -- 134.401 seconds elapsed + LL9b + elapsedTime LL9c=select(LL9b,L->(not isSmoothableSemigroup(L,0.4,0))); -- 26.7357 seconds elapsed + LL9c=={} -- => every genus 8 semigroup is Weierstrass + "); + + if g == 10 then print(" + LL10=findSemigroups 10;#LL10 + LL10a=select(LL10,L->not knownExample L);#LL10a + elapsedTime LL10b=select(LL10a,L-> elapsedTime not isSmoothableSemigroup(L,0.6,0)); -- 418.486 seconds elapsed + #LL10b + elapsedTime LL10c=select(LL10b,L->(<(<(< every genus 10 semigroup is Weierstrass + "); + + if g == 11 then print(" + LL11=findSemigroups 11;#LL11 + LL11a=select(LL11,L->not knownExample L);#LL11a + last LL11a, last LL11 -- shows that all examples of genus 11 not covered by Plueger have multiplicity <= 10. + + elapsedTime nonWeierstrassSemigroups(5,11) -- 117.422 seconds elapsed - + LLdifficult={{6, 8, 17, 19, 21},{6, 8, 10, 19, 21, 23},{6, 9, 11, 14}} + elapsedTime nonWeierstrassSemigroups(6,11,LLdifficult,Verbose=>true) -- 267.818 seconds elapsed + --(6, 11, all but difficult semigroups are smoothable) + elapsedTime LL611=select(LLdifficult,L->(<true))); -- 197.l321 seconds elapsed + + elapsedTime nonWeierstrassSemigroups(7,11, LLdifficult, Verbose => true) --257 sec + LLdifficult={{8, 9, 11, 15, 21}} + elapsedTime nonWeierstrassSemigroups(8,11, LLdifficult, Verbose => true) + LLdifficult={} + elapsedTime nonWeierstrassSemigroups(9,11, LLdifficult, Verbose => true) + LLdifficult={} + elapsedTime nonWeierstrassSemigroups(10,11, LLdifficult, Verbose => true) + "); + ) + + + +/// +restart +debug loadPackage( "NumericalSemigroups", Reload => true) +LL11=findSemigroups 11;#LL11 + LL11a=select(LL11,L->not knownExample L);#LL11a + last LL11a, last LL11 -- shows that all examples of genus 11 not covered by Plueger have multiplicity <= 10. + +LabBookProtocol 7 + LL7=findSemigroups 7;#LL7 + LL7a=select(LL7,L->not knownExample L);#LL7a + elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0,Verbose=>true)) + elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0)) + LL7b=={} + + LL8=findSemigroups 8;#LL8 + LL8a=select(LL8,L->not knownExample L);#LL8a + elapsedTime LL8b=select(LL8a,L-> not isSmoothableSemigroup(L,0.40,0)) -- 16.7345 seconds elapsed + LL8b=={{6,8,9,11}} + elapsedTime LL8c=select(LL8b,L-> not isWeierstrassSemigroup(L,0.15)) -- 1.88664 seconds elapsed + LL8c=={} -- => every genus 8 semigroup is Weierstrass + + LL9=findSemigroups 9;#LL9 + LL9a=select(LL9,L->not knownExample L);#LL9a + elapsedTime LL9b=select(LL9a,L->(not isSmoothableSemigroup(L,0.5,0)));#LL9b -- 134.401 seconds elapsed + LL9b + elapsedTime LL9c=select(LL9b,L->(not isSmoothableSemigroup(L,0.4,0))); -- 26.7357 seconds elapsed + LL9c=={} -- => every genus 9 semigroup is Weierstrass + + + LL10=findSemigroups 10;#LL10 + LL10a=select(LL10,L->not knownExample L);#LL10a + elapsedTime LL10b=select(LL10a,L-> elapsedTime not isSmoothableSemigroup(L,0.6,0)); -- 418.486 seconds elapsed + #LL10b + elapsedTime LL10c=select(LL10b,L->(<(<(< every genus 10 semigroup is Weierstrass + + elapsedTime nonWeierstrassSemigroups(5,11,Verbose =>true) -- 117.422 seconds elapsed - + + LLdifficult={{6, 8, 17, 19, 21},{6, 8, 10, 19, 21, 23},{6, 9, 11, 14}} + elapsedTime nonWeierstrassSemigroups(6,11,LLdifficult,Verbose=>true) -- 267.818 seconds elapsed + --(6, 11, all but difficult semigroups are smoothable) + elapsedTime LL611=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + + + LLdifficult ={} + elapsedTime nonWeierstrassSemigroups(7,11,LLdifficult,Verbose=>true) -- 267.818 seconds elapsed + elapsedTime LL711=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + -- 951.724 seconds elapsed + --o3 == {} + + LLdifficult ={{8, 9, 11, 15, 21}} + elapsedTime nonWeierstrassSemigroups(8,11,LLdifficult,Verbose=>true) + elapsedTime LL811=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + + + LLdifficult ={} + elapsedTime nonWeierstrassSemigroups(9,11,LLdifficult,Verbose=>true) + elapsedTime LL911=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + -- 998.636 seconds elapsed + o4 = {} + + LLdifficult ={} + elapsedTime nonWeierstrassSemigroups(10,11,LLdifficult,Verbose=>true) + elapsedTime LL1011=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + -- 2104.78 seconds elapsed + --o5 == {} + + + LLdifficult = {{6, 9, 17, 19, 20, 22},} + elapsedTime nonWeierstrassSemigroups(6,12,LLdifficult,Verbose=>true) + elapsedTime LL612=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + + + + + + LLdifficult={} + elapsedTime nonWeierstrassSemigroups(5,12,LLdifficult,Verbose=>true) -- 152.485 seconds elapsed + oo == {} + + LLdifficult={} + elapsedTime nonWeierstrassSemigroups(7,12,LLdifficult,Verbose=>true) -- 152.485 seconds elapsed + oo == {} + + + + +/// + numberToMonomial = (R, n) -> ( + --n should be an element of the semigroup from which R is made. + --Thus if n \equiv i mod m, we can express m as x_0^p*x_i + b := basis(n, R); + if b==0 then error"No element of degree n in R"; + (entries b)_0_0 + ) + +fractionalIdeal = method(Options => {"Ideal" => true}) +fractionalIdeal(List, List) := o -> (sgrp, mons) -> ( + --sgrp is a list of ZZ_{>0}, interpreted as generators of a semigroup; + --mons is a list of ZZ interpreted as generating a module in the quotient field of sgrp + --with the option "Ideal" => false we get a list of integers, otherwise an ideal. + if not gcd sgrp == 1 then error"sgrp has wrong quotient field"; + c := conductor sgrp; + mons0 := min mons; + ans := {c}; -- a default value. + ss := semigroup sgrp; + nonGens :=sums(sgrp, mons); + newMons := sort (mons | nonGens); + for i from -mons0 to c do( + newMonsPlus := sums({i}, newMons); + m := select(newMonsPlus, j -> j true) + sgrp = {5,9} + R = semigroupRing sgrp + mons = semigroup sgrp + apply(mons, n -> numberToMonomial(R,n)) + fractionalIdeal(sgrp, mons_{4..7}) + numberToMonomial(R,23) +sgrp = {4,7,10,13} +mons = {3,4} -- generators of first blowup +semigroup sgrp +R = semigroupRing sgrp +n = 7 +numberToMonomial(R,7) +fractionalIdeal(sgrp, mons, "Ideal"=>false) +fractionalIdeal(sgrp, mons) + +/// +-* Documentation section *- + +beginDocumentation() + + +document { +Key => NumericalSemigroups, +Headline => "Compute invariants of a numerical semigroup", + "In this package we consider numerical semigroups: that is, cofinite subsets of the natural numbers that are closed under sums. + We generally refer to these simply as semigroups. + + A semigroup S thus includes the empy sum, 0, but we input semigroups by giving generators, all nonzero. + The smallest nonzero element of S is the multiplicity. The Apery set (really sequence) of a semigroup S is the + the list {a_1..a_m-1} where a_i is the smallest element in S such that a_i = i mod m. + The conductor is 1 plus the largest element not in S. We generally specify a semigroup by giving + a list of positive integers L with gcd = 1, representing the semigroup of all sums of + elements of L.", + + PARA{}, + SUBSECTION "Combinatorial properties of the Kunz cone", + UL{ + TO coneEquations, + TO mu, + TO facetRays, + TO coneRays, + TO allSemigroups, + TO findSemigroups, + TO buchweitzCriterion, + TO buchweitz, + TO buchweitzSemigroups, + }, + SUBSECTION "Properties of semigroup rings", + UL{ + TO burchIndex, + TO semigroupRing, + TO socle, + TO kunzRing, + TO isSymmetric + }, + SUBSECTION "Weierstrass semigroups", + "The question whether every semigroup is a Weierstrass semigroup was answered negatively + by Buchweitz: the semigroup generated by {13, 14, 15, 16, 17, 18, 20, 22, 23} is not a Weierstrass semigroup, + as demonstrated in ", TO buchweitz,". + On the other hand Pinkham gave a positve criterion with deformation theory. + A semigroup is a Weierstrass semigroup if and only if the graded semigroup ring of L + has a smoothing deformation with strictly positive deformation parameters.", + PARA{}, + + "In this section we implemented Pinkham's approach in POSITIVE CHARACTERISTIC. We plan + to extend the smoothing results to characteristic 0 in the future.", + UL{ + TO makeUnfolding, + TO flatteningRelations, + TO getFlatFamily, + TO findPoint, + TO isARandomFiberSmooth, + TO heuristicSmoothness, +-- TO isSmoothableSemigroup, + TO isWeierstrassSemigroup, + TO nonWeierstrassSemigroups, + TO LabBookProtocol, + } +} + +doc /// +Key + LabBookProtocol + (LabBookProtocol, ZZ) +Headline + Weierstrass Semigroups in Low genus +Usage + s = LabBookProtocol g +Inputs + g:ZZ + genus +Outputs + s:String + commands to study semigroups of genus g +Description + Text + This function prints a series of commands that check that most semigroups of genus g (up to g = 10) are Weierstrass. + It outputs a short list of "difficult" examples that currently take too long to check. + Example + LabBookProtocol 7 + LL7=findSemigroups 7;#LL7 + LL7a=select(LL7,L->not knownExample L);#LL7a + elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0,Verbose=>true)) + elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0)) + LL7b=={} + Text + With the option Verbose=>true one gets timings on various parts of the computation. + To check all semigroups of genus g=8,9 and 10 takes about + + 18.2, 161.1 and 945.6 seconds respectively. + + Example + LabBookProtocol 11 + Text + Since the number of cases gets rather large, we break up the list of all semigroups + into sublists of semigroups of given multiplicity and call the function nonWeierstrassSemigroups: + Example + m=5,g=8 + elapsedTime nonWeierstrassSemigroups(m,g,Verbose=>true) + Text + In the verbose mode we get timings of various computation steps and further information. + The first line, + (13,1), + indicates that there 13 semigroups of multiplicity 5 and genus 8 of which only 1 is not flagged + as smoothable by the function knownExample. + The second line, + {5,8,11,12}, + gives the current semigroup. + The timing under various headers tells how much time was used in each of the steps. + Example + L={6,8,9,11} + genus L + isWeierstrassSemigroup(L,0.2,Verbose=>true) + Text + The first integer, 6, tells that in this attempt deformation parameters of degree >= 6 were used and no smooth fiber was found. + Finally with all parameters of degree >= 4, the flatteningRelations define a scheme that decomposes into 2 components, + both affine spaces. If we encounter non affine components we print "has to solve", and find a point in each such component. + We then print the number of singular points in the fiber. + Finally the output "{0,-1}" is the dimension of the singular loci of a random fiber over each component. + Thus the entry "-1" indicates that a general fiber of the second component is smooth. + +SeeAlso + isSmoothableSemigroup + isWeierstrassSemigroup + nonWeierstrassSemigroups + knownExample +/// + +doc /// +Key + knownExample + (knownExample, List) +Headline + Is L a known Weierstrass semigroup? +Usage + b = knownExample L +Inputs + g:ZZ + genus +Outputs + b:Boolean + true if L is a known example of a Weierstrass semigroup +Description + Text + Certain semigroups are known to be Weierstrass. For example L has 2 or 3 generators only, by work of Pinkham and Sally. + Another sort examples are semigroup with small weight ewt(L) < genus L by the work Nathan Pflueger extending + work of Eisenbud-Harris. + Example + L={7,12,13} + knownExample L + L={7,8,9,11,13} + ewt L, genus L + knownExample L + LL=findSemigroups(9,10);#LL + select(LL,L->not knownExample L) + #oo +SeeAlso + LabBookProtocol + findSemigroups +/// + +doc /// +Key + buchweitzCriterion + (buchweitzCriterion, List) + (buchweitzCriterion,ZZ,List) +Headline + Does L satisfies the Buchweitz criterion? +Usage + d = buchweitzCriterion L + d = buchweitzCriterion(m,L) +Inputs + L:List + generators of a semigroup or the aperyset of a semigroup + m:ZZ + the multiplicity of the semigroup +Outputs + d:ZZ +Description + Text + A Weierstrass semigroups L satisfies + + 3*(genus L-1) -#sums(G,G) >=0. + + The function returns this difference. + + Example + L={7,12,13} + buchweitzCriterion L + L= buchweitz 0 + buchweitzCriterion L + (H,M)=allSemigroups L + b=(entries M)_0 + g=(entries H)_0 + apply(3,i->buchweitzCriterion(13,b+i*g)) + +SeeAlso + buchweitz +/// + +doc /// +Key + apery + (apery, List) +Headline + Compute the apery set, multiplicity and conductor +Usage + A = apery L +Inputs + L: List + of positive integers +Outputs + A:HashTable +Description + Text + The smallest nonzero element of s is the \emph{multiplicity}. The Apery set (really sequence) of a semigroup S is the + the list {a_1..a_m-1} where a_i is the smallest element in s such that a_i = i mod m. + The \emph{conductor} is 1 plus the largest element \emph{not} in S. We generally specify a semigroup by giving + a list of positive integers L with gcd = 1, representing the semigroup of all sums of + elements of L. + Example + L = {3,5} + apery L +SeeAlso + aperySet +/// + +doc /// +Key + aperySet + (aperySet, List) + (aperySet, HashTable) +Headline + Compute the apery set of a numerical semigroup +Usage + as = aperySet L + aS = aperySet HL +Inputs + L: List + of positive integers + H: HashTable + as computed by H = apery L +Outputs + aS: List +Description + Text + L is taken as generators of a numerical semigroup S; should have gcd = 1. + The apery set is then the list aS = {a_1..a_(m-1)} where m is the smallest + element of L, and a_i is the smallest element of S with a_i = i mod m. + Example + aperySet {3,5} + semigroup {3,5} +SeeAlso + apery +/// + +doc /// +Key + semigroup + (semigroup, List) +Headline + Compute the semigroup generated by a list of positive integers +Usage + L = semigroup L0 +Inputs + L0: List +Outputs + L: List +Description + Text + The semigroup is actually computed by the function apery, and + semigroup L = (apery L)#"semigroup" + Example + semigroup {5,4} +SeeAlso + apery +/// + +doc /// +Key + isSymmetric + (isSymmetric, List) +Headline + test whether the semigroup generated by L is symmetric +Usage + t = isSymmetric L +Inputs + L: List +Outputs + t: Boolean +Description + Text + Suppose that c = conductor S, so that c-1 is the last gap. If x in S, and x (i+1)+(b_i*m)) +SeeAlso + aperySet +/// + + +doc /// +Key + (genus, List) +Headline + Compute the number of gaps (genus) of a semigroup +Usage + g = genus L +Inputs + L: List +Outputs + g: ZZ +Description + Text + The gaps S is the list of the finitely many positive integers not in S + Example + genus {4,7} + G = gaps {4,7} + #G + S = semigroup{4,7} + set G + set S == set(0..21) +SeeAlso + gaps + semigroup +/// + +doc /// +Key + kunzMatrix + (kunzMatrix, List) + (kunzMatrix, HashTable) +Headline + determine the set of facet equations satisfied by a semigroup +Usage + M = kunzMatrix L + M = kunzMatrix H +Inputs + L: List + H: HashTable + such as produced by apery +Outputs + M: Matrix + of 0s and 1s +Description + Text + The equations defining the facets of the homogeneous Kunz cone P_m^* + are + E_(i,j): a_i+a_j = a_(i+j mod m) for those (i,j) such that i+j != 0 mod m. + + Given a list L generating the semigroups s + with Apery set a = {a_1..a_i}, M = kunzMatrix L has a 1 in the (i,j) position + if and only if a satisfies equation E_(i,j). Thus M = kunzMatrix L + is a symmetric matrix of 0s and 1s that determines the face + of the kunz cone P on which it lies. + Example + L = {4,7} + aperySet L + kunzMatrix L +SeeAlso + aperySet +/// +doc /// +Key + findSemigroups + (findSemigroups, ZZ, ZZ, ZZ) + (findSemigroups, ZZ, ZZ) + (findSemigroups, ZZ) +Headline + Find all semigroups with a given number of gaps, multiplicity and/or conductor + +Usage + LL = findSemigroups(mult, cond, numgaps) + LL = findSemigroups(mult, numgaps) + LL = findSemigroups(numgaps) +Inputs + mult: ZZ + multiplicity + cond: ZZ + conductor + numgaps: ZZ + number of gaps +Outputs + LL: List + of sequences of generators of semigroups with the given invariants +Description + Text + If S is the Weierstrass semigroup of a point p on a Riemann surface X -- that + is, the semigroup of pole orders of rational functions at p, + then the genus of X is the number of gaps of S and there is a + differential on X vanishing to order exactly d iff d+1 is a gap. + Example + findSemigroups(5,14,8) + G = gaps {5,7,9} + #G + Text + The number of vanishing orders of quadratic differentials + on is h^0(2K) = (4g-4) - g + 1 = 3g-3, + so if s is the semigroup of pole orders of a point on X + and G is the set of gaps, then there can be at most 3g-3 distinct + sums of pairs of elements of G. This gives a nontrivial obstruction + to the smoothability of the semigroup ring of S and thus to the + existence of a Weierstrass point with semigroup s. + + The following example, discovered by Ragnar Buchweitz (Thesis) + was the first known example of a non-Weierstrass semigroup. + Example + G=toList(1..12)|{19,21,24,25} + Text + The function @TO isGapSequence@ returns generators for + the semigroups with given gap sequence or returns false if there is + no such semigroup + Example + L=isGapSequence G + g = #G + 3*g-3 + #sums(G,G) +SeeAlso + isGapSequence + gaps +/// + +/// +restart +debug loadPackage("NumericalSemigroups",Reload=>true) +G=toList(1..12)|{19,21,24,25} +L=isGapSequence G +I=semigroupIdeal L +S=ring I +inI=trim ideal(gens I%S_0) +fI=res I +degrees fI_2 +elapsedTime (A,unfolding)=makeUnfolding I; -- 14.1952 seconds elapsed +numgens A +tally degrees A + +elapsedTime J=flatteningRelations(I,A,unfolding); +elapsedTime gb J; dim J; +elapsedTime (A1=vars A%J) + +/// + + + + +doc /// +Key + (mingens, List) +Headline + Find a mininmal set of semigroup generators +Usage + L' = mingens L +Inputs + L: List + generators of a semigroup +Outputs + L': List + minimal generators of the same semigroup +Description + Text + The set of generators is minimal if it has empty + intersection with the set of sums of non-zero generators. + + It would have been nicer to overload @TO mingens@ to + accept a list. + Example + L = semigroup {3,7} + mingens L +SeeAlso + semigroup +/// + +doc /// +Key + socle + (socle, List) +Headline + elements of the semigroup that are in the socle mod the multiplicity +Usage + socle L +Inputs + L:List + generators of a semigroup +Outputs + L:List + subset of the Apery set representing the socle mod the multiplicity +Description + Text + Let S = semigroup L + be a numerical semigroup with minimal non-zero element m, + and consider the artinian ring + A(s) = k[{t^i : i in s]/(t^m). + The socle of A(s) is the sum of the minimal nonzero ideals, + and socle L is a set of generators of the socle + Example + L = {3,7} + s = semigroup L + socle L + L = {3,4,5} + s = semigroup L + socle L +SeeAlso + semigroup +/// + + doc /// +Key + type + (type, List) +Headline + type of the local semigroup ring +Usage + r = type L +Inputs + L:List + of semigroup generators +Outputs + r: ZZ + the type +Description + Text + The type of a local Cohen-Macaulay ring is the number + of generators of the canonical module, or equivalently the + dimension of the socle of an zero-dimensional reduction. + + For example, the type of a complete intersection such as + the semigroup ring of a semigroup generated by 2 elements. + Example + type {3,5} +SeeAlso + socle +/// +doc /// +Key + gaps + (gaps, List) +Headline + The gap sequence of a semigroup +Usage + G = gaps L +Inputs + L: List + of semigroup generators +Outputs + G: List + the gap sequence +Description + Text + If semigroup L is the Weierstrass semigroup of a Riemann surface + C at a point, then #gaps L = g = h^0(omega_C), the genus of C. Furthermore, + the number of elements of sums(n, G) is bounded by the dimension of + h^0(omega_C^n) = n*(2g-2)-g+1 = (2n-1)g-2n+1. However, for + an arbitrary semigroup the number #sums(n,G) may be larger; + the first such example was found by Ragnar Buchweitz, and + is given below. + + The function isGapSequence returns either false or generators + of the semigroup of which the sequence is the gap sequence. + + Example + G=toList(1..12)|{19,21,24,25} + g = #G + for n from 1 to 3 list (#sums(n,G),n*(2*g-2) - g + 1) + L=isGapSequence G + G ==gaps L +Caveat +SeeAlso + isGapSequence + findSemigroups +/// +doc /// +Key + sums + (sums, List, List) + (sums, ZZ, List) +Headline + sum of two sequences +Usage + L = sums(L1, L2) + L = sums(n,L1) +Inputs + L1: List + L2: List + n:ZZ +Outputs + L:List +Description + Text + sums(L1,L2) returns a sorted list of the unique + sums of nonzero elements of L1 with L2; + sums(n, L1) returns the sorted list of unique sums + of n nonzero elements of L1. + Example + L1 = {2,3} + L2 = {4,5} + sums(L1, L2) + sums(1, L1) == L1 + sums(L1, L1) + sums(2,L1) + Text + Of course the sequence of arbitrary sums of elements including 0 + is essentially semigroup L. To get just the sums of n elements, + one could write: + Example + n = 3 + {0}|sort unique flatten (for i from 1 to n list sums(i,L1)) +/// + +doc /// +Key + def1 + (def1, List) +Headline + degrees of a basis of T^1 +Usage + D = def1 L +Inputs + L: List + generators of a semigroup +Outputs + D: List + degrees of a basis of T^1(semigroupRing L) +Description + Text + T^1(B) is the tangent space to the versal deformaion of + the ring B, and is finite dimensional when B has isolated + singularity. If B = S/I is a Cohen presentation, then + T^1(B) = coker Hom(Omega_S, B) -> Hom(I/I^2, B). + When B is a semigroup ring, then Henry Pinkham proved that + an open subset of the space of elements of T1 of + negative degree correspond to smoothings of the projective cone + of the semigroup ring to Riemann surfaces + Example + def1{2,3} +/// + +doc /// +Key + (conductor, List) +Headline + conductor of a semigroup +Usage + c = conductor L +Inputs + L:List + of generators of a semigroup +Outputs + c:ZZ + conductor of the semigroups +Description + Text + Semigroups in this package are additively closed + cofinite subsets of ZZ_{>= 0}. The conductor + is the smallest element c such that c+i is + in the semigroup for all i >= 0. For a semigroup + generated by two elements a,b, the conductor + is (a-1)(b-1), but for semigroups with more + generators there is no known formula. + Example + conductor {3,5} + conductor {5, 7, 9, 13} +/// + +doc /// +Key + facetRays + (facetRays, List) +Headline + computes the rays spanning the face in which a semigroup lies +Usage + R = facetRays L +Inputs + L:List + of generators of a semigroup +Outputs + R:Matrix + of integers; the columns are the rays + of the face on which semigroup L lies +Description + Text + Uses the Fourier-Motzkin algorithm to go from + the @TO coneEquations@ satisfied by the semigroup + to the rays. For example, in multiplicity 3, + the cone has two rays, occupied by the + semigroups semigroup{3,4} and semigroup{3,5}, + with semigroup{3,4,5} in the interior. + The rays are given in reduced form (a vector + of positive integers with gcd 1), and appear + as the columns of the output matrix. + Example + aperySet{3,4} + facetRays{3,4} + facetRays{3,5} + facetRays{3,4,5} + Text + On the face with the @TO buchweitz@ example there are two facet rays: + Example + F = facetRays buchweitz 0 + Text + The second column is mu buchweitz 0, the mu vector of the Buchweitz example. + Adding multiples of it to the Weierstrass semigroups ordinary point + of genus 12, we eventually reach a semigroup that fails the Buchweitz + test to be a Weierstrass semigroup: + Example + b = {0}|flatten entries F_{1} + L = toList (13..25) + for i from 0 to 15 list ( + L' = L+i*13*b; + G = gaps L'; + #sums(G, G) - 3*(genus L' -1) + ) + Text + We conjecture that the same phenomen for any semigroup L0 + of multiplicity 13 in place of L. Here is a "random" example: + Example + setRandomSeed 0 + L0 = {13}|aperySet ({13}|apply(1 + random 10, i->13+random 10)) + for i from 0 to 20 list ( + L' = L0+i*13*b; + G = gaps L'; + #sums(G, G) - 3*(genus L' -1) + ) +SeeAlso + aperySet + coneEquations + coneRays +/// + + +doc /// +Key + allSemigroups + (allSemigroups, List) + (allSemigroups, ZZ) +Headline + Compute the Hilbert basis and module generators of a cone of semigroups +Usage + (H,M) = allSemigroups L + (H,M) = allSemigroups m +Inputs + L:List + of generators of a semigroup + m: ZZ + the multiplicity of the semigroups +Outputs + H:Matrix + of integers; the rows form the Hilbert basis of the cone + M:Matrix + of module generators of the cone +Description + Text + Using Normaliz we compute the face of the Kunz cone containg L. + In case of allSemigroups m the output descibes the complete Kunz cone + of all semigroups of multiplicity m. + Example + allSemigroups {4,7,9} + allSemigroups 4 + Text + On the face with the @TO buchweitz@ example there are two facet rays: + Example + (H,M) = allSemigroups buchweitz 0 + Text + The first row of H is 13*(mu buchweitz 0), the mu vector of the Buchweitz example. + Adding multiples of the first row to the Weierstrass semigroups of an ordinary point + on a curve of genus 12, we eventually reach a semigroup that fails the Buchweitz + test to be a Weierstrass semigroup: + Example + b = {0}|flatten (entries H)_0 + L = toList (13..25) + for i from 0 to 15 list ( + L' = L+i*b; + G = gaps L'; + 3*(genus L' -1)-#sums(G,G) + ) + Text + By Riemann-Roch the quantity 3*(genus L' -1)-#sums(G,G) is non-negative + for Weierstrass semigroups. + We conjecture that the same thing is true for any semigroup L0 + of multiplicity 13 in place of L. Here is a "random" example: + Example + setRandomSeed 0 + L0 = {13}|aperySet ({13}|apply(1 + random 10, i->13+random 10)) + for i from 0 to 20 list ( + L' = L0+i*b; + G = gaps L'; + 3*(genus L' -1)-#sums(G,G) + ) +SeeAlso + aperySet + coneEquations + buchweitzCriterion +/// + +doc /// +Key + semigroupRing + (semigroupRing, List) + [semigroupRing, "BaseField"] +Headline + forms the semigroup ring over "BaseField" +Usage + A = semigroupRing L +Inputs + L:List + of semigroup generators +Outputs + A:Ring + algebra over "BaseField" +Description + Text + If the basering is kk, the semigroup ring + is A = kk[x^S] where x^S denotes the set of + monomials in variables x_i with exponent + vectors in S, and kk is the field that is the value + of the option "BaseField" (ZZ/101 by default). + + If m is the multiplicity of S, + the semigroup ring depends up to an + isomorphism that may change the degrees, + only on the face of the Kunz cone + in which the semigroup lies. + + Semigroup rings are interesting as + examples, and arise as Weierstrass semigroups + of points on algebraic curves: if p in C + is such a point, then the Weierstrass semigroup + of C at p is the set of pole orders of rational + functions with poles only at p, and the + semigroupRing is the associated graded ring of the filtered ring + $\bigcup_{n >= 0} H^0(O_C(np))$. + For non-Weierstrass + points the semigroup is 0,g+1,g+2.., and there are + finitely many "Weierstrass" point p + whose semigroup has weight >=2. + + For example if C is a smooth plane quartic, + then at each ordinary flex point, the semigroup is + 0,3,5,6,7,.. + + Example + semigroupRing {3,4,5} + weight {4,5,6,7}, gaps {4,5,6,7} + semigroupRing {4,5,6,7} + weight {3,5,7}, gaps {3,5,7} + semigroupRing {3,5,7} + weight {3,4}, gaps {3,4} + semigroupRing({3,4}, "BaseField" => QQ) +SeeAlso + semigroupIdeal + weight + /// + +doc /// +Key + makeUnfolding + (makeUnfolding, Ideal) + (makeUnfolding, List) + [makeUnfolding, "BaseField"] + [makeUnfolding, Verbose ] +Headline + Makes the universal homogeneous unfolding of an ideal with positive degree parameters +Usage + (A,unfolding) = makeUnfolding I + (A,unfolding) = makeUnfolding sgrp +Inputs + I:Ideal + sgrp:List + generators of a semigroup +Outputs + A: Ring + algebra of unfolding parameters + unfolding: Matrix + equations of the unfolding +Description + Text + Given a (quasi)homogenous ideal in a ring S = kk[x_0..x_n] + the function creates a positively graded polynomial ring A = kk[a_{i,j}] + and computes the unfolding of I as an ideal + of SA = kk[x_0..x_n, a_{i,j}]. This can be used as a step in computing the + semi-universal deformation of the affine cone defined by I. + + In the case of + + makeUnfolding sgrp + + the routine first forms the ideal of the semigroup ring, and applies makeUnfolding to this. + Example + L={4,5,7} + I := semigroupIdeal L; + (A,unfolding):= makeUnfolding I; + S=ring I + fI=res I + degs=flatten (gens A/degree) + n=floor(max degs/2+3) + restricted=ideal select(gens A, y-> (degree y)_0 (degree y)_0true) + Text + In the verbose mode we get timings of various computation steps and further information. + The first line, + (17,5), + indicates that there 17 semigroups of multiplicity 6 and genus 8 of which only 5 is not flagged + as smoothable by the function knownExample. + The second line, + {6, 7, 8, 17}, + gives the current semigroup. + The timing under various headers tells how much time was used in each of the steps. +SeeAlso + isWeierstrassSemigroup + LabBookProtocol + /// + + + + + + + + +doc /// +Key + getFlatFamily + (getFlatFamily, List, RR, ZZ) + [getFlatFamily, "BaseField"] + [getFlatFamily, Verbose ] +Headline + Compute the flat family depending on a subset of parameters of the universal unfolding +Usage + (I,J1,family)=getFlatFamily(L,RR,ZZ) +Inputs + L:List + the generators of a semigroup + r:RR + n:ZZ + numbers which influences the truncation +Outputs + I: Ideal + semigroup ideal + J1:Ideal + flatness relations among the parameters + family: Matrix + defining equation of the family +Description + Text + After computing an unfolding and restricting the + unfolding to variables of degree larger than + + (maximal degree of a parameter)*r+n, + + we compute the flattening relations and remove dependent variables. + The remaining flattening relation are returned in the ideal J1. + Using the function isARandomFiberSmooth we then can check with good luck + whether a random fiber over some component of J1 is smooth. + Example + L={6,8,10,11} + genus L + (I,J1,family)=getFlatFamily(L,0.30,0); + betti res ideal family == betti res I + isARandomFiberSmooth(I,J1,family) + support family + support family /degree + gens ring J1 /degree + Text + Parameters of the universal unfolding of degree <= 22*0.3 are not used + Example + (I,J1,family)=getFlatFamily(L,0.00,11); + support family + support family /degree + Text + Parameters of the universal unfolding of degree < 11) are not used + Example + isARandomFiberSmooth(I,J1,family) + A = ring family + transpose family +SeeAlso + makeUnfolding + flatteningRelations + getFlatFamily + isARandomFiberSmooth + /// + +doc /// +Key + isARandomFiberSmooth + (isARandomFiberSmooth, Ideal, Ideal, Matrix) + [isARandomFiberSmooth, "BaseField"] + [isARandomFiberSmooth, Verbose ] +Headline + Test whether a random fiber is smooth +Usage + b=isARandomFiberSmooth(I,J1,family) +Inputs + I: Ideal + semigroup ideal + J1:Ideal + flatness relations among the parameters + family:Matrix + a flat family +Outputs + b: Boolean + true if a random fiber is smooth, false otherwise +Description + Text + We check whether a random fiber over a random closed point of each component of J1 is smooth. + If we find a smooth fiber we return true, else we return false. + Example + L={6,8,10,11} + genus L + (I,J1,family)=getFlatFamily(L,0.30,0); + isARandomFiberSmooth(I,J1,family) + SA=ring family + transpose family +SeeAlso + makeUnfolding + flatteningRelations + getFlatFamily + /// + + doc /// +Key + heuristicSmoothness + (heuristicSmoothness, Ideal) + [heuristicSmoothness, "BaseField"] + [heuristicSmoothness, Verbose ] +Headline + Check whether an affine curve is smooth +Usage + b=heuristicSmoothness c +Inputs + c: Ideal + of an affine curve +Outputs + b: Boolean + true if the computation showes that c is smooth false otherwise +Description + Text + We check for smoothness using only some of the minors of + the jacobian matrix. If we are lucky this establishes smoothness. + With bad luck we might fail even in case when c is smooth. + Example + kk=ZZ/2; S=kk[x_0..x_3] + setRandomSeed "some singular and some smooth curves"; + elapsedTime tally apply(10,i-> ( + c=minors(2,random(S^2,S^{3:-2})); + c=sub(c,x_0=>1); + R=kk[support c];c=sub(c,R); + heuristicSmoothness c)) +SeeAlso + +/// + +doc /// +Key + buchweitz + (buchweitz, ZZ) +Headline + An example of a semigroup that is not a Weierstrass semigroup +Usage + L = buchweitz i +Inputs + i:ZZ +Outputs + L:List + generators of a semigroup +Description + Text + For i>=0 this produces a semigroup B with genus 16+i, conductor 26+2i, and + #sums(2, gaps buchweitz i) = 3*(genus B -1)+1). This implies + that these semigroups are NOT Weierstrass semigroups by the + following argument, first employed by Buchweitz: + + If L generates the Weierstrass semigroup of a point x + on a Riemann surface C, then the gaps L is the + set {1+v | v is the order at p of vanishing of a global + section of \omega_C}. Thus + sums(d, #gaps L) <= dim H^0(\omega_C^{d) = d*(2g-1) - g + 1. + Example + B = buchweitz 0 + g = #gaps B + m = 3 + 2*(2*g-2) - g + 1 + #sums(2, gaps B) + Text + More such semigroups can be found with @TO buchweitzSemigroups@ +Acknowledgement + The result was written in Ragnar Buchweitz' These d'Etat, + but never otherwise published by Buchweitz. In the meantime it became + famous anyway. +/// + +doc /// +Key + buchweitzSemigroups + (buchweitzSemigroups, ZZ) + (buchweitzSemigroups, ZZ, ZZ) + (buchweitzSemigroups, ZZ, ZZ, ZZ) +Headline + Finds semigroups that are not Weierstrass semigroups by the Buchweitz test +Usage + LL = buchweitzSemigroups g + LL = buchweitzSemigroups (m,g) + LL = buchweitzSemigroups (m,c,g) +Inputs + g:ZZ + genus + m:ZZ + mutiplicity + c:ZZ + conductor +Outputs + LL:List + list of semigroups +Description + Text + Uses findSemigroups to produce lists of semigroups with the given + invariants, and then uses the Buchweitz test: the following + inequality holds for Weierstrass semigroups: + sums(2, #gaps L) <= dim H^0(\omega_C^{2) = 2*(2g-1) - g + 1. + Example + B = buchweitzSemigroups (13,26,16) + buchweitz 0 + B = buchweitzSemigroups (14,28,17) + Text + The second example in these two cases are part of the sequence defined in @TO buchweitz@. As g increases + there are many more. + Example + #buchweitzSemigroups (15,30,18) +SeeAlso + buchweitz + findSemigroups +/// + + +doc /// +Key + isGapSequence + (isGapSequence, List) +Headline + test whether a list of integers can be the list of gaps of a semigroup +Usage + L = isGapSequence G +Inputs + G: List +Outputs + L:Boolean + L:List +Description + Text + The function isGapSequence returns either false or + a list of generators + of the semigroup of which the sequence is the gap sequence. + Note that the gap sequence of a semigroup of multiplicity m + begins with 1..m-1, and ends with the Frobenius number c-1, + where c is the conductor. + Example + G = {1,2,3,4,6,9,11,14} + isGapSequence G + G = {1,2,3,4,6,9,11} + S = isGapSequence G + G == gaps S +SeeAlso + gaps +/// + +doc /// +Key + ewt + effectiveWeight + (ewt, List) + (effectiveWeight, List) +Headline + Effective weight of a semigroup (Pflueger) +Usage + w = ewt L +Inputs + L: List + generators of a semigroup +Outputs + w: ZZ + the effective weight +Description + Text + The effective weight of a semigroup S is defined as the number + of pairs (a,b) such that a is a minimal generator of S and b is a gap of S with a "x"] + [semigroupIdeal, "MinimalGenerators"=>true] + [semigroupIdeal, "BaseField" => ZZ/101] +Headline + The ideal defining the semigroup ring +Usage + I = semigroupIdeal L +Inputs + L: List +Outputs + I: Ideal +Description + Text + The semingroup ideal of the semigroup generated by L + is the kernel of the map kk[x_0..x_(#L)] -> kk[t] + sending x_i to t^(L_i), where kk is the specified BaseField, + defaulting to ZZ/101 and x is the specified VariableName. + If the option "MinimalGenerators" is set to true, the default, then + the program first computes a minimal set of generators from L; + if it is set to false, the program uses L itself. + Example + semigroupIdeal {5,7} + semigroupIdeal({5,7,10}, "MinimalGenerators" => false) +SeeAlso + mingens + semigroupRing +/// +doc /// +Key + aperySemigroupRing + (aperySemigroupRing, List) +Headline + computes the semigroup ring using both the multiplicity and the full Apery set +Usage + R = aperySemigroupRing L +Inputs + L: List +Outputs + R: Ring +Description + Text + While the function semigroupRing L uses just a minimal set of generators, + the function aperySemigroupRing L uses the larger Apery set, and puts + the generator corresponding to the multiplicity at the end. + Example + L = {5,6} + aperySet L + gens aperySemigroupRing L + gens semigroupRing L +SeeAlso + semigroupRing + aperySet + mingens +/// + +/// +restart +loadPackage ("NumericalSemigroups", Reload => true) +uninstallPackage "NumericalSemigroups" +restart +installPackage "NumericalSemigroups" +check "NumericalSemigroups" +--<0}, interpreted as generators of a semigroup; + mons is a list of ZZ interpreted as generating a module in the quotient field of sgrp + with the option "Ideal" => false we get a list of integers belonging to the semigroup, + otherwise a proper ideal of the semigroup ring. + of the ring semigroupRing sgrp. In both cases, the program chooses the + generators of least possible degree. + + This is perhaps most useful when regarding a blowup or iterated blowup as a module + over the original ring. For example, the sequence of blowups of the semigroupRing {5,9} + is given by semigroupRing{4,5}, semigroupRing{1}: + Example + sgrp = {5,9} + sgrp1 = {4,5} + sgrp2 = {1} + fractionalIdeal(sgrp, sgrp1, "Ideal"=>false) + fractionalIdeal(sgrp, sgrp2) +SeeAlso + semigroupRing +/// + +doc /// +Key + coneEquations + (coneEquations, ZZ) + (coneEquations, List) + [coneEquations, "Inhomogeneous"] +Headline + Find the equations of the Kunz cones +Usage + M = coneEquations m + M = coneEquations sgrp +Inputs + m:ZZ + multiplicity + sgrp:List + generators of a semigroup +Outputs + M:Matrix + m-1 x d matrix whose columns represent inequalities defining the Kunz cone +Description + Text + Let S be the numerical semigroup defined by a list sgrp, + have multiplicity m and apery set a_1,\dots,a_(m-1) and + set mu_i = (a_i -i)//m. The homogeneous Kunz cone of + semigroups of multiplity m is the convex polyhedral cone + defined by the inequalities of the form + + a_i + a_j - a_(i+j) \geq 0. + + where 1\leq i,j\leq m-1 and i+j\neq m is interpreted mod m. + The function coneEquations m returns an m-1 x d matrix of ZZ + whose columns are the coefficients of the left hand sides of these inequalities. + The function coneEquations sgrp does the same, with additional columns representing + the additional inequalities of this type that are satisfied by + the Apery set apery(sgrp). For m = 3, the semigroup {3,4,5} is interior (and thus + satisfies no further equations), while the semigroups {3,4} and {3,5} are on + the two extremal rays of the cone. + Example + coneEquations 3 + coneEquations {3,4,5} + coneEquations {3,4} + coneEquations {3,5} + allSemigroups 3 + Text + The inhomogeneous Kunz cone does the same, but for the numbers mu_i instead of + a_i. Thus when i+j > m the inequality mu_i+mu_j-mu_(i+j) \geq 0 is replaced by the inequality + + mu_i+mu_j - mu_(i+j) -1. + + The function coneEquations(m, "Inhomogeneous" => true) returns the same matrix + as in the homogeneous case, with one more row, where the last row represents the + constant terms of this inquality: + Example + eq=coneEquations(3, "Inhomogeneous" => true) + coneEquations({3,4,5}, "Inhomogeneous" => true) + coneEquations({3,4}, "Inhomogeneous" => true) + coneEquations({3,5}, "Inhomogeneous" => true) + (H,M)=allSemigroups 3 + (H,M)=allSemigroups 4 + M1=(M|matrix apply(rank target M,i->{-1})) + eqInh=coneEquations(4, "Inhomogeneous" => true) + eqh=coneEquations(4) + M1*eqInh + H*eqh + Text + All entries of M1*eqInh and H*eqh are non-negative as desired. +References + Kunz, Ernst: Klassification numerische Halbgruppen +Caveat +SeeAlso + apery + coneRays +/// + +doc /// +Key + coneRays + (coneRays, ZZ) +Headline + All the rays of the (homogeneous) Kunz cone +Usage + M = coneRays m +Inputs + m:ZZ + multiplicity +Outputs + M:Matrix + of ZZ -- columns are vectors on the rays of the cone +Description + Text + Uses the Fourier-Motzkin algorithm to compute the rays from the list of supporting hyperplanes, + which is given by @TO coneEquations@. The number of rays grows rather quickly with m; + the actual number is unknown. Use @TO facetRays@ to determine the rays bounding the face + on which a given semigroup lies. + Example + coneRays 3 + coneRays 4 + facetRays {4,5,6} +SeeAlso + coneEquations + facetRays +/// + + +--< true) + sgrp = {3,5} + R = semigroupRing sgrp + mons = semigroup sgrp + assert(apply(mons, n -> numberToMonomial(R,n)) == {1, x_0, x_2, x_0^2, x_0*x_2, x_0^3, x_2^2}) + assert( + I := fractionalIdeal(sgrp, {2,3}); + R := ring I; + I == ideal(R_1,R_0^2) + ) +/// + + TEST ///-*buchweitzSemigroups*- +assert(buchweitzSemigroups 6 == {}) +--elapsedTime buchweitzSemigroups(13,16) +/// + +TEST///-*test of findPoint*- +kk=ZZ/101 +R=kk[x_0..x_5] +setRandomSeed 0 +c=ideal random(R^1,R^{2:-1,2:-2}) +point=findPoint c +assert(sub(c,point)== 0) +/// + +TEST///-*flattening and unfolding*- +assert ((L = mingens {5,6, 8,9, 10,12, 13, 17}) == {5, 6, 8, 9}) +I=semigroupIdeal L +(A,unfolding)=makeUnfolding I; +assert(numgens A == 68) +J=flatteningRelations(I,A,unfolding); +numgens J +assert(numgens J == 260) +/// + +TEST/// -*aperySemigroupRing *- +L = {5,6} +assert(aperySet L == {6, 12, 18, 24}) +assert(numgens aperySemigroupRing L == 1+ #aperySet L) +/// + +TEST/// -*semigroupIdeal*- +I = semigroupIdeal({4,5}, + "VariableName"=> z, + "BaseField" => ZZ/3, + "MinimalGenerators"=>false) +assert(char ring I == 3 and +toString I == toString ideal(z_0^5-z_1^4)) +/// + +TEST/// -*mu*- +assert(mu{5,7} == {4, 1, 5, 2}) +assert(mu apery{5,7} == {4, 1, 5, 2}) +/// + + +TEST/// -*buchweitz*- +i = 2 +gaps (B = buchweitz i) +assert(#sums(2, gaps buchweitz i) == 3*(genus B -1)+1) +/// + +TEST/// -*def1*- +assert(def1{2,3} == {-6, -4}) + +/// + +TEST/// -*burchIndex*- +assert(burchIndex {6,7,8,9,10,11} == 5 and +burchIndex (L = {3,4,5}) == 2 and +burchIndex {6,19,22, 35} == 0 and -- this is Gorenstein and +burchIndex {14, 19, 21, 29, 36} == 3 +) +/// + + +TEST/// -*sums*- + L1 = {2,3} + L2 = {4,5} + assert (sums(L1, L2) == {6,7,8}) + assert(sums(1, L1) == L1) + assert(sums(2,L1) == {4,5,6}) +/// + +TEST///-*gaps*- +assert((G = gaps{3,5}) == {1, 2, 4, 7}) +s = select (semigroup {3,5}, i -> i < conductor{3,5}) +assert(#G==#s) +/// + +TEST///-*findSemigroups*- +assert(findSemigroups(3,8,4) == {{3,5}}) +assert(findSemigroups(5,14,8) == { + {5, 7, 11}, + {5, 7, 9}, + {5, 6, 14}, + {5, 9, 11, 12}}) +/// + +TEST///-*type*- +assert(type {3,4} == 1 and type {5,6,7,8,9} == 4) +/// + + +TEST ///-* Buchweitz example of nonsmoothable semigroup and isGapSequence*- +G=toList(1..12)|{19,21,24,25} +L=isGapSequence G +G1=gaps L +G1==G +assert(#sums(G1,G1)>3*(#G1-1)) +/// + +TEST///-*mingens*- +assert ((L = mingens {5,6, 8,9, 10,12, 13, 17}) == {5, 6, 8, 9}) +assert(mingens {3, 5, 8, 9, 10}== {3,5}) +assert(mingens ({3, 4, 5, 6, 7, 9, 10, 12}) == {3,4,5}) +assert(mingens {3,3,5,5} == {3,5}) +assert(mingens semigroup {3,7} == {3,7}) +assert(mingens {8, 10, 31, 129, 130} == {8, 10, 31}) +/// + + +TEST///-*socle*- +L = {9, 23, 28, 31} +socle L == {84, 79, 62} +/// + +TEST/// -*conductor*- +assert(conductor {7, 24} == 6*23) +/// + +TEST///-*test of facetRays*- +assert(facetRays{3,4} == matrix"1;2") +assert(facetRays{3,5} == matrix"2;1") +assert(facetRays{3,4,5} == matrix"1,2;2,1") +/// + + +TEST///-*test of option*- + R = semigroupRing({3,5,7}, "BaseField" => QQ) + assert(char R == 0) + /// + +TEST///-*test of allSemigroups*- + (H,M)=allSemigroups 3 + assert(H==matrix{{3,3},{3,6},{6,3}}) + assert(M==matrix{{4,5},{4,8},{7,5},{10,5}}) +/// + + +TEST///-*test of coneEquations*- + (H,M)=allSemigroups 3 + eq=coneEquations 3 + assert(all(flatten entries (H*eq),e->e>=0)) + eqInh=coneEquations(3,"Inhomogeneous" => true) + M1=(M|matrix apply(rank target M,i->{-1})) + assert(all(flatten entries (M1*eqInh),e->e>=0)) +/// + +end-- + +-* Development section *- +restart +loadPackage ("NumericalSemigroups", Reload=>true) +uninstallPackage "NumericalSemigroups" +restart +installPackage "NumericalSemigroups" +check "NumericalSemigroups" +viewHelp "NumericalSemigroups" + + + +L1={13,14,15,16,17,18,20,22} +(gL1,bL1)=allSemigroups L1 +buchweitzCriterion L1 +b=aperySet L1 +g=(entries gL1)_2 +apply(10,i->(L=prepend(13,b+i*g);G=gaps L;-#sums(G,G)+3*(#G-1))) +L=prepend(13,b+2*g) + +G=gaps L;#sums(G,G)-3*(#G-1) +(gL,bL)=allSemigroups L +gL= +first entries gL1 +#bL +netList apply(bL,b->tally flatten apply(5,i->apply(4,j->(Lbij=prepend(15,(b+i*gL 0+j*gL_1)); + G=gaps Lbij; (#sums(G,G)-3*(#G-1)))))) +(g,b)=allSemigroups LL_1 +g=7 +elapsedTime LL=flatten apply(toList(2..g),m->findSemigroups(m,2*g,g)) + + + + +L=buchweitz 20 +L=mingens ({10}|apply(7,i->random((i+1)*11)+11)) +m=min L +a=aperySet L +am=mu apery L +am +G=gaps L + +Gm=apply(m-1,i->select(G,j->j%m==i+1)) +apply(m,k-> #unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {}))-max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) + + + +--netList apply(m,k-> apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then +-- (sums(Gm_(i-1),Gm_(j-1))) else {}))) + + +sum(m,k-> (mk=max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0)); + ki=select(toList(1..m-1),i->(j=(k-i)%m; + j=!=0 and am_(i-1)+am_(j-1)-1 ==mk)); + max apply(ki,i->(j=(k-i)%m;mk+if i+j>m then 1 else 0))))-1 +oo==#sums(G,G) + +sum(m,k->max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1+if i+j>m then 1 else 0) else 0)))-1 +oo==#sums(G,G) +#G,3*(#G-1) +buchweitzCriterion L + +L={13}|apply(9,i->i+1+13)|apply(3,i->i+1+11+2*13) +aperySet L +(B,M)=allSemigroups L +g=((entries B)_0)_({0..4}|{9,6,9,7,8,10,11}) +b=(entries M)_0 +Lis=apply(10,i->{13}|b+i*g) +apply(Lis,L->buchweitzCriterion L) + + + + + + + +apply(m,k-> max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (#sums(Gm_(i-1),Gm_(j-1))) else 0))) + +#sums(G,G) + +apply(m,k-> unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {})))== +apply(m,k->select(sums(G,G),j->j%m==k)) + +apply(m,k-> max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (#sums(Gm_(i-1),Gm_(j-1))) else 0)))== +apply(m,k-> max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) + +apply(m,k-> all apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (#sums(Gm_(i-1),Gm_(j-1)))==(am_(i-1)+am_(j-1)-1) else true))) + + +sort flatten apply(m,k-> unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {})))== +sums(G,G) + +sum(m,k-> max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) +== +#sums(G,G) + + +))) +apply(m,k-> unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {}))) +netList apply(m,k-> apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {}))) + + +apply(m,k-> unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {})))== +apply(m,j->select(sums(G,G),i->i%m==j)) +apply(m,k-> #unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {}))==max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) + +sum(m,k->#select(sums(G,G),i->i%m==k)) +#sums(G,G) +sum(m,k-> max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) + +tally apply(m,k-> #unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {}))==max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) + +18, 24, 25, 26, 28, 30, 33 + + From 9c94ece51cd38f89743a0fcb022e1e036ce067f6 Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 09:52:35 -0700 Subject: [PATCH 114/226] adding =dist... --- M2/Macaulay2/packages/=distributed-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/M2/Macaulay2/packages/=distributed-packages b/M2/Macaulay2/packages/=distributed-packages index 7340172fa28..fd0b27f4ae6 100644 --- a/M2/Macaulay2/packages/=distributed-packages +++ b/M2/Macaulay2/packages/=distributed-packages @@ -274,3 +274,4 @@ MultigradedBGG MultigradedImplicitization Msolve SCMAlgebras +NumericalSemigroups From 20e51960bd3a93dcd91de74b5a44f5a5223f6e16 Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 10:13:16 -0700 Subject: [PATCH 115/226] NumericalSemigroups.m2 --- M2/Macaulay2/packages/NumericalSemigroups.m2 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/M2/Macaulay2/packages/NumericalSemigroups.m2 b/M2/Macaulay2/packages/NumericalSemigroups.m2 index c3dd1dc7f90..4de4bb79a79 100644 --- a/M2/Macaulay2/packages/NumericalSemigroups.m2 +++ b/M2/Macaulay2/packages/NumericalSemigroups.m2 @@ -1,13 +1,14 @@ newPackage( "NumericalSemigroups", - Version => "0.1", - Date => "March 12, 2024", + Version => "1.0", + Date => "October 25, 2024", Headline => "Compute the Apery set and invariants of a numerical semigroup ring", Authors => {{ Name => "David Eisenbud", Email => "de@berkeley.edu", HomePage => "eisenbud.github.io"}, { Name => "Frank-Olaf Schreyer", Email => "schreyer@math.uni-sb.de", HomePage => "https://www.math.uni-sb.de/ag/schreyer/index.php/publications/publications-frank-olaf-schreyer"}}, AuxiliaryFiles => false, - DebuggingMode => true, - PackageExports => {"FourierMotzkin","Normaliz", "IntegralClosure", "FastMinors", "RandomPoints"} + DebuggingMode => false, + PackageExports => {"FourierMotzkin","Normaliz", "IntegralClosure", "FastMinors", "RandomPoints"}, + Keywords => {"Commutative Algebra", "Algebraic Geometry", "Combinatorics"} ) /// restart @@ -22,6 +23,7 @@ viewHelp "NumericalSemigroups" viewHelp Normaliz /// +--"done" indicates that there is a TEST installed for that function. export { "apery", --done FOS "aperySet", --done FOS @@ -60,7 +62,6 @@ export { "isARandomFiberSmooth", --done FOS "getFlatFamily", --done FOS "isWeierstrassSemigroup", -- done FOS --- "estimateTruncationRatio", "nonWeierstrassSemigroups", -- done FOS "LabBookProtocol", --done FOS "fractionalIdeal", --done From 8ff0d71aef3536fdff405f7ef1be81740893ae9a Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 10:19:18 -0700 Subject: [PATCH 116/226] edited spelling --- M2/Macaulay2/packages/NumericalSemigroups.m2 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/M2/Macaulay2/packages/NumericalSemigroups.m2 b/M2/Macaulay2/packages/NumericalSemigroups.m2 index 4de4bb79a79..1bcfd34d722 100644 --- a/M2/Macaulay2/packages/NumericalSemigroups.m2 +++ b/M2/Macaulay2/packages/NumericalSemigroups.m2 @@ -855,7 +855,7 @@ flatteningRelations(Ideal,Ring, Matrix) := (I,A,unfolding) -> ( SA := ring unfolding; chMat:=getChangeMatrix gbI; unfoldingGB := unfolding*sub(chMat,SA); - -- can one use the build in gb algorithm to copute the + -- can one use the build in gb algorithm to compute the -- flattening relations faster unfGBf:=forceGB unfoldingGB; ldT := flatten entries leadTerm unfoldingGB; @@ -1439,7 +1439,7 @@ Headline => "Compute invariants of a numerical semigroup", "In this package we consider numerical semigroups: that is, cofinite subsets of the natural numbers that are closed under sums. We generally refer to these simply as semigroups. - A semigroup S thus includes the empy sum, 0, but we input semigroups by giving generators, all nonzero. + A semigroup S thus includes the empty sum, 0, but we input semigroups by giving generators, all nonzero. The smallest nonzero element of S is the multiplicity. The Apery set (really sequence) of a semigroup S is the the list {a_1..a_m-1} where a_i is the smallest element in S such that a_i = i mod m. The conductor is 1 plus the largest element not in S. We generally specify a semigroup by giving @@ -1471,7 +1471,7 @@ Headline => "Compute invariants of a numerical semigroup", "The question whether every semigroup is a Weierstrass semigroup was answered negatively by Buchweitz: the semigroup generated by {13, 14, 15, 16, 17, 18, 20, 22, 23} is not a Weierstrass semigroup, as demonstrated in ", TO buchweitz,". - On the other hand Pinkham gave a positve criterion with deformation theory. + On the other hand Pinkham gave a positive criterion with deformation theory. A semigroup is a Weierstrass semigroup if and only if the graded semigroup ring of L has a smoothing deformation with strictly positive deformation parameters.", PARA{}, @@ -2224,8 +2224,8 @@ Outputs of module generators of the cone Description Text - Using Normaliz we compute the face of the Kunz cone containg L. - In case of allSemigroups m the output descibes the complete Kunz cone + Using Normaliz we compute the face of the Kunz cone containing L. + In case of allSemigroups m the output describes the complete Kunz cone of all semigroups of multiplicity m. Example allSemigroups {4,7,9} @@ -2348,7 +2348,7 @@ Outputs equations of the unfolding Description Text - Given a (quasi)homogenous ideal in a ring S = kk[x_0..x_n] + Given a (quasi)homogeneous ideal in a ring S = kk[x_0..x_n] the function creates a positively graded polynomial ring A = kk[a_{i,j}] and computes the unfolding of I as an ideal of SA = kk[x_0..x_n, a_{i,j}]. This can be used as a step in computing the From 698010f452ca0bcee69326af34e4c0d1ebbb658e Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 25 Sep 2024 11:19:45 -0400 Subject: [PATCH 117/226] Check that list is nonempty before calling factory function Otherwise we get a segfault --- M2/Macaulay2/e/interface/factory.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/M2/Macaulay2/e/interface/factory.cpp b/M2/Macaulay2/e/interface/factory.cpp index 957b2e59c03..7a827a7ee0a 100644 --- a/M2/Macaulay2/e/interface/factory.cpp +++ b/M2/Macaulay2/e/interface/factory.cpp @@ -785,6 +785,11 @@ M2_arrayintOrNull rawIdealReorder(const Matrix *M) } } + if (I.length() == 0) { + ERROR("expected at least one generator"); + return nullptr; + } + List t = neworderint(I); int n = t.length(); From 5b3445604b7e43a2f53d09483179a3a250dac796 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 3 Sep 2024 10:43:35 -0400 Subject: [PATCH 118/226] Set ForeignFunctions license to GPL-2+ --- M2/Macaulay2/packages/ForeignFunctions.m2 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index f193f177dcc..44b87367a10 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -1,3 +1,21 @@ +-- ForeignFunctions package for Macaulay2 +-- Copyright (C) 2022-2024 Doug Torrance + +-- This program is free software; you can redistribute it and/or +-- modify it under the terms of the GNU General Public License +-- as published by the Free Software Foundation; either version 2 +-- of the License, or (at your option) any later version. + +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. + +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +-- 02110-1301, USA. + newPackage("ForeignFunctions", Headline => "foreign function interface", Version => "0.3", From 0d861ab586fb4f6350681da5444fe7eee7fc41d2 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 3 Sep 2024 12:13:09 -0400 Subject: [PATCH 119/226] Add subnodes to ForeignFunctions docs to improve table of contents --- M2/Macaulay2/packages/ForeignFunctions.m2 | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index 44b87367a10..a98a17e0f57 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -697,6 +697,13 @@ doc /// value oo Text It is powered by @HREF{"https://sourceware.org/libffi/", "libffi"}@. + Subnodes + :Types + ForeignFunction + SharedLibrary + ForeignType + ForeignObject + Pointer /// doc /// @@ -723,6 +730,10 @@ doc /// Example ptr + 5 ptr - 3 + Subnodes + "nullPointer" + address + (symbol SPACE, ForeignType, Pointer) /// doc /// @@ -757,6 +768,18 @@ doc /// LI {TT "Address", ", ", ofClass Pointer, ", a pointer to the ", "corresponding ", TT "ffi_type", " object, used by ", TO (address, ForeignType), "."}}@ + Subnodes + (size, ForeignType) + :Subtypes + ForeignArrayType + ForeignIntegerType + ForeignPointerType + ForeignPointerArrayType + ForeignRealType + ForeignStringType + ForeignStructType + ForeignUnionType + ForeignVoidType /// doc /// @@ -894,6 +917,9 @@ doc /// ulong SeeAlso mpzT + Subnodes + mpzT + (symbol SPACE, ForeignIntegerType, Number) /// doc /// @@ -964,6 +990,9 @@ doc /// Example float double + Subnodes + mpfrT + (symbol SPACE, ForeignRealType, Number) /// doc /// @@ -1025,6 +1054,11 @@ doc /// @TT "voidstar"@. Example voidstar + Subnodes + (symbol SPACE, ForeignPointerType, Pointer) + ((symbol *, symbol =), voidstar) + (symbol *, ForeignType, voidstar) + getMemory /// doc /// @@ -1060,6 +1094,8 @@ doc /// arrays. There is one built-in type, @TT "charstar"@. Example charstar + Subnodes + (symbol SPACE, ForeignStringType, String) /// doc /// @@ -1114,6 +1150,9 @@ doc /// Example x_0 = 9 x + Subnodes + foreignArrayType + (symbol SPACE, ForeignArrayType, VisibleList) /// doc /// @@ -1227,6 +1266,9 @@ doc /// Example x_0 = "qux" x + Subnodes + foreignPointerArrayType + (symbol SPACE, ForeignPointerArrayType, VisibleList) /// doc /// @@ -1293,6 +1335,9 @@ doc /// This is the class for @wikipedia("Struct_(C_programming_language)", "C struct")@ types. There are no built-in types. They must be constructed using @TO "foreignStructType"@. + Subnodes + foreignStructType + (symbol SPACE, ForeignStructType, VisibleList) /// doc /// @@ -1364,6 +1409,9 @@ doc /// This is the class for @wikipedia("Union_type", "C union")@ types. There are no built-in types. They must be constructed using @TO "foreignUnionType"@. + Subnodes + foreignUnionType + (symbol SPACE, ForeignUnionType, Thing) /// doc /// @@ -1532,6 +1580,12 @@ doc /// Use @TO class@ to determine the type of the object. Example class x + Subnodes + foreignObject + foreignSymbol + (value, ForeignObject) + (symbol SPACE, ForeignType, ForeignObject) + (registerFinalizer, ForeignObject, Function) /// doc /// @@ -1724,6 +1778,8 @@ doc /// Example mpfr = openSharedLibrary "mpfr" peek mpfr + Subnodes + openSharedLibrary /// doc /// From d69410ff97274b86b74ee91ed49a7e5bd146df2f Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 3 Sep 2024 12:13:41 -0400 Subject: [PATCH 120/226] Link registerFinalizer doc from foreignFunction doc --- M2/Macaulay2/packages/ForeignFunctions.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index a98a17e0f57..fe94c771a93 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -1875,7 +1875,7 @@ doc /// Text If the foreign function allocates any memory, then register a finalizer for its outputs to deallocate the memory during garbage collection using - @TT "registerFinalizer"@. + @TO (registerFinalizer, ForeignObject, Function)@. Example malloc = foreignFunction("malloc", voidstar, ulong) free = foreignFunction("free", void, voidstar) From f7f438a17792a73c0b919e04be6420aa4feb4ae3 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 3 Sep 2024 12:14:01 -0400 Subject: [PATCH 121/226] Add more info about basic example in ForeignFunctions toplevel node --- M2/Macaulay2/packages/ForeignFunctions.m2 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index fe94c771a93..9b8621982b1 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -690,13 +690,22 @@ doc /// Text This package provides the ability to load and call "foreign" functions from shared libraries and to convert back and forth between Macaulay2 - things and the foreign objects used by these functions. + things and the foreign objects used by these functions. It is powered + by @HREF{"https://sourceware.org/libffi/", "libffi"}@. + + As a simple example, we call the @CODE "cos"@ function from the C + standard library, which sends a @CODE "double"@ (a real number + represented as a double-precision floating point number) to another + @CODE "double"@, the cosine of the input. Example mycos = foreignFunction("cos", double, double) mycos pi value oo Text - It is powered by @HREF{"https://sourceware.org/libffi/", "libffi"}@. + In this example, we created a @TO ForeignFunction@ object using the + @TO foreignFunction@ constructor method and specified that both its + output and input were instances of the @TO double@ type, which is one + of several @TO ForeignType@ objects that are available. Subnodes :Types ForeignFunction From 66440fe611c5b395b27bb32b17c24e207b937cfd Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 3 Sep 2024 12:24:27 -0400 Subject: [PATCH 122/226] Cross-reference getMemory and registerFinalizer Both deal directly with the garbage collector --- M2/Macaulay2/packages/ForeignFunctions.m2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index 9b8621982b1..5cdec1899d2 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -702,7 +702,7 @@ doc /// mycos pi value oo Text - In this example, we created a @TO ForeignFunction@ object using the + In this example, we created a @CODE "ForeignFunction"@ object using the @TO foreignFunction@ constructor method and specified that both its output and input were instances of the @TO double@ type, which is one of several @TO ForeignType@ objects that are available. @@ -1765,6 +1765,8 @@ doc /// finalizer = x -> (print("freeing memory at " | net x); free x) for i to 9 do (x := malloc 8; registerFinalizer(x, finalizer)) collectGarbage() + SeeAlso + getMemory /// doc /// @@ -1952,6 +1954,8 @@ doc /// should be set will be determined automatically. Example ptr = getMemory int + SeeAlso + (registerFinalizer, ForeignObject, Function) /// doc /// From a5070e53e85622d3d1920246de01863df9aa05c2 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 3 Sep 2024 16:18:28 -0400 Subject: [PATCH 123/226] Add FFTW example to ForeignFunctions package docs --- M2/Macaulay2/packages/ForeignFunctions.m2 | 158 ++++++++++++++++++++++ 1 file changed, 158 insertions(+) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index 5cdec1899d2..481d117901b 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -706,7 +706,15 @@ doc /// @TO foreignFunction@ constructor method and specified that both its output and input were instances of the @TO double@ type, which is one of several @TO ForeignType@ objects that are available. + + See also the following additional examples: + + @UL { + LI {TOH "fast Fourier transform example"} + }@ Subnodes + :Examples + "fast Fourier transform example" :Types ForeignFunction SharedLibrary @@ -2010,6 +2018,156 @@ doc /// allocated. Otherwise, segmentation faults may occur! /// +doc /// + Key + "fast Fourier transform example" + Headline + fast Fourier transforms using foreign function calls to the FFTW library + Description + Text + In this example, we make foreign function calls using the + @HREF{"https://www.fftw.org/", "FFTW"}@ library to compute fast Fourier + transforms for polynomial multiplication. + + Once FFTW is installed, there should be a file named @CODE "libfftw3.so"@ + or @CODE "libfftw3.dylib"@ available on the system in one of the standard + shared library directories. We can then open the library using + @TO openSharedLibrary@. + CannedExample + i2 : libfftw = openSharedLibrary "fftw3" + + o2 = fftw3 + + o2 : SharedLibrary + Text + Next, we create our foreign functions using the constructor method + @TO foreignFunction@. We will need three: one to wrap + @CODE "fftw_plan_dft_1d"@, which creates the plan for a fast Fourier + transform computation, one to wrap @CODE "fftw_execute"@, which actually + does the computation, and one to wrap @CODE "fftw_destroy_plan"@, + which deallocates the memory allocated by @CODE "fftw_plan_dft_1d"@. + + Let's walk through each of these. + + According to the FFTW documentation, @CODE "fftw_plan_dft_1d"@ has the + following signature: @CODE "fftw_plan fftw_plan_dft_1d(int n0, + fftw_complex *in, fftw_complex *out, int sign, unsigned flags)"@. + Our goal is to compute the discrete Fourier transform + $\mathscr F\{\mathbf a\}$ of a vector $\mathbf a\in\CC^n$. In this case, + @CODE "n0"@ will be $n$, @CODE "in"@ will be $\mathbf a$ represented as + an array of $2n$ @TO double@ objects (alternating between real and + imaginary parts), @CODE "out"@ will be an array ultimately containing + $\mathscr F\{\mathbf a\}$, @CODE "sign"@ will be 1 unless we want to + compute the inverse discrete Fourier transform + $\mathscr F^{-1}\{\mathbf a\}$, in which case it will be $-1$. Finally, + @CODE "flags"@ will contain planning flags for the computation. When + setting up our foreign function objects, we won't worry about the + structures of the @CODE "fftw_plan"@ or @CODE "fftw_complex"@ types and + will just use @TO voidstar@ to indicate that they are pointers. + CannedExample + i3 : fftwPlanDft1d = foreignFunction(libfftw, "fftw_plan_dft_1d", voidstar, + {int, voidstar, voidstar, int, uint}) + + o3 = fftw3::fftw_plan_dft_1d + + o3 : ForeignFunction + Text + Next, we define foreign functions for @CODE "fftw_execute"@, which has + signature @CODE "void fftw_execute(const fftw_plan plan)"@, and + @CODE "fftw_destroy_plan"@, which has signature + @CODE "void fftw_destroy_plan(fftw_plan plan)"@. + CannedExample + i4 : fftwExecute = foreignFunction(libfftw, "fftw_execute", void, voidstar) + + o4 = fftw3::fftw_execute + + o4 : ForeignFunction + + i5 : fftwDestroyPlan = foreignFunction(libfftw, "fftw_destroy_plan", void, voidstar) + + o5 = fftw3::fftw_destroy_plan + + o5 : ForeignFunction + Text + Now we wrap these functions inside Macaulay2 functions. Since + computing $\mathscr F\{\mathbf a\}$ and $\mathscr F^{-1}\{\mathbf a\}$ + using FFTW requires only changing the @CODE "sign"@ parameter of the + call to @CODE "fftw_plan_dft_1d"@, we create a helper function that + will do most of the work. + + This helper function takes a list @CODE "x"@ representing the vector + $\mathbf a$ as well as the value of @CODE "sign"@, allocates the + memory required for the @CODE "in"@ and @CODE "out"@ lists using + @TO getMemory@, and then calls the foreign function + @CODE "fftwPlanDft1d"@. Note that we pass 64 as the value of + @CODE "flags"@. This specifies the @CODE "FFTW_ESTIMATE"@ planning + flag, which uses a simple heuristic to quickly pick a plan for the + computation. We then call + @TO (registerFinalizer, ForeignObject, Function)@ to make sure + that the @CODE "fftw_plan"@ object that was returned is properly + deallocated during garbage collection. Next, we set up the @CODE "in"@ + array by finding the real and imaginary parts of the elements of + @CODE "x"@ and assigning them using @TO ((symbol *, symbol =), voidstar)@. + Finally, we call @CODE "fftw_execute"@ and convert the result back + to a list of complex numbers. + CannedExample + i6 : fftHelper = (x, sign) -> ( + n := #x; + inptr := getMemory(2 * n * size double); + outptr := getMemory(2 * n * size double); + p := fftwPlanDft1d(n, inptr, outptr, sign, 64); + registerFinalizer(p, fftwDestroyPlan); + dbls := splice apply(x, y -> (realPart numeric y, imaginaryPart numeric y)); + apply(2 * n, i -> *(value inptr + i * size double) = double dbls#i); + fftwExecute p; + r := ((2 * n) * double) outptr; + apply(n, i -> value r_(2 * i) + ii * value r_(2 * i + 1))); + + i7 : fastFourierTransform = method(); + + i8 : fastFourierTransform List := x -> fftHelper(x, -1); + + i9 : inverseFastFourierTransform = method(); + + i10 : inverseFastFourierTransform List := x -> fftHelper(x, 1); + Text + One application of fast Fourier transforms is log-linear time + multiplication of polynomials. Indeed, if $f,g\in\CC[x]$ have degrees + $m$ and $n$, respectively, and if $\mathbf a,\mathbf b\in\CC^{m+n+1}$ are + the vectors formed by taking $a_i$ to be the coefficient of $x^i$ in $f$ + and $b_i$ the coefficient of $x_i$ in $g$, then + $\frac{1}{m+n+1}\mathscr F^{-1}\left\{\mathscr F\{\mathbf a\}\cdot + \mathscr F\{\mathbf b\}\right\}$, where $\mathscr F\{\mathbf a\}\cdot + \mathscr F\{\mathbf b\}$ is computed using component-wise multiplication, + contains the coefficients of the product $fg$. In some cases, this process + can be faster than Macaulay2's native polynomial multiplication. + + Let's look at a particular example. + CannedExample + i11 : fftMultiply = (f, g) -> ( + m := first degree f; + n := first degree g; + a := fastFourierTransform splice append( + apply(m + 1, i -> coefficient(x^i, f)), n:0); + b := fastFourierTransform splice append( + apply(n + 1, i -> coefficient(x^i, g)), m:0); + c := inverseFastFourierTransform apply(a, b, times); + sum(m + n + 1, i -> c#i * x^i)/(m + n + 1)); + + i12 : R = CC[x]; + + i13 : f = x - 1; + + i14 : g = x^2 + x + 1; + + i15 : fftMultiply(f, g) + + 3 + o15 = x - 1 + + o15 : R +/// + TEST /// ----------- -- value -- From eae98075b52597a3452adb201fb5cb6547bdd4c0 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 5 Sep 2024 17:01:40 -0400 Subject: [PATCH 124/226] Add LAPACK example to ForeignFunctions docs --- M2/Macaulay2/packages/ForeignFunctions.m2 | 96 ++++++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index 481d117901b..d3519097153 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -710,11 +710,13 @@ doc /// See also the following additional examples: @UL { - LI {TOH "fast Fourier transform example"} + LI {TOH "fast Fourier transform example"}, + LI {TOH "general linear model example"} }@ Subnodes :Examples "fast Fourier transform example" + "general linear model example" :Types ForeignFunction SharedLibrary @@ -2168,6 +2170,98 @@ doc /// o15 : R /// +doc /// + Key + "general linear model example" + Headline + constrained least squares using foreign function calls to the LAPACK library + Description + Text + In this example, we make foreign function calls to + @HREF{"https://www.netlib.org/lapack/", "LAPACK"}@ to solve constrained + least squares problems. LAPACK is already used by Macaulay2 for a number + of its linear algebra computations, but some functions aren't available. + + One of these is @CODE "dggglm"@, which solves constrained least squares + problems that have applications to general Gauss-Markov linear models in + statistics. In particular, suppose $A$ is an $n\times m$ real matrix, + $B$ is an $n\times p$ real matrix, and $\mathbf d$ is a vector in + $\RR^n$. We would like to find the vectors $\mathbf x\in\RR^m$ and + $\mathbf y\in\RR^p$ that minimize $\|\mathbf y\|$ subject to the + constraint $\mathbf d = A\mathbf x + B\mathbf y$. + + The @CODE "dggglm"@ function does exactly this. Its signature is + @CODE "void dggglm_(int *n, int *m, int *p, double *A, int *ldA, + double *B, int *ldB, double *d, double *x, double *y, double *work, + int *lwork, int *info)"@. Note the trailing underscore that was + added by the Fortran compiler. Each of the 13 arguments are pointers, + so we use @TO voidstar@ to represent them in our call to + @TO foreignFunction@. Since Macaulay2 is already linked against LAPACK, + we don't need to worry about calling @TO openSharedLibrary@. + Example + dggglm = foreignFunction("dggglm_", void, toList(13:voidstar)) + Text + The parameters @CODE "n"@, @CODE "m"@ and @CODE "p"@ are exactly the + numbers $n$, $m$, and $p$ above. The parameters @CODE "A"@, @CODE "B"@, + and @CODE "d"@ are arrays that will store the entries of $A$, $B$, and + $\mathbf d$. LAPACK expects these to be in column-major order, in + contrast to the row-major order used by Macaulay2. So we add + helper methods to take care of this conversion. The local variable + @CODE "T"@ is a @TO ForeignArrayType@ created by + @TO (symbol *, ZZ, ForeignType)@. + Example + toLAPACK = method(); + toLAPACK Matrix := A -> ( + T := (numRows A * numColumns A) * double; + T flatten entries transpose A); + toLAPACK Vector := toLAPACK @@ matrix; + Text + The parameters @CODE "ldA"@ and @CODE "ldB"@ are the "leading dimensions" + of the arrays @CODE "A"@ and @CODE "B"@. We will use $n$ for both. The + arrays @CODE "x"@ and @CODE "y"@ will store the solutions. The array + @CODE "work"@ has dimension @CODE "lwork"@ (for which we will use $n + m + + p$) that the procedure will use as a workspace. Finally, @CODE "info"@ + stores the return value (0 on success). + + The following method prepares matrices $A$ and $B$ and a vector + $\mathbf d$ to be sent to the foreign function we created above, and then + converts the solutions into a sequence two of Macaulay2 vectors. Note + that we use @TO getMemory@ to allocate memory for @CODE "x"@, @CODE "y"@, + and @CODE "info"@ (which we name @CODE "i"@ here to avoid conflicting + with @TO info@) and @TO address@ to get pointers to the other integer + arguments. We also use @TO (symbol *, ForeignType, voidstar)@ to + dereference @CODE "i"@ and determine whether the call was successful. + Example + generalLinearModel= method(); + generalLinearModel(Matrix, Matrix, Vector) := (A, B, d) -> ( + if numRows A != numRows B + then error "expected first two arguments to have the same number of rows"; + n := numRows A; + m := numColumns A; + p := numColumns B; + x := getMemory(m * size double); + y := getMemory(p * size double); + lwork := n + m + p; + work := getMemory(lwork * size double); + i := getMemory int; + dggglm(address int n, address int m, address int p, toLAPACK A, + address int n, toLAPACK B, address int n, toLAPACK d, x, y, work, + address int lwork, i); + if value(int * i) != 0 then error("call to dggglm failed"); + (vector value (m * double) x, vector value (p * double) y)); + Text + Finally, let's call this method and solve a constrained least squares + problem. This example is from + @HREF{"https://doi.org/10.1080/01621459.1981.10477694", + "Kourouklis, S., & Paige, \"A Constrained Least Squares Approach to + the General Gauss-Markov Linear Model\""}@. + Example + A = matrix {{1, 2, 3}, {4, 1, 2}, {5, 6, 7}, {3, 4, 6}}; + B = matrix {{1, 0, 0, 0}, {2, 3, 0, 0}, {4, 5, 1e-5, 0}, {7, 8, 9, 10}}; + d = vector {1, 2, 3, 4}; + generalLinearModel(A, B, d) +/// + TEST /// ----------- -- value -- From c28fd6e6023b6c67a6eed1c5b5b8daf8ff8be746 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 6 Sep 2024 13:47:19 -0400 Subject: [PATCH 125/226] Add JIT example to ForeignFunctions docs --- M2/Macaulay2/packages/ForeignFunctions.m2 | 66 ++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index d3519097153..6d1b89bf7de 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -711,12 +711,14 @@ doc /// @UL { LI {TOH "fast Fourier transform example"}, - LI {TOH "general linear model example"} + LI {TOH "general linear model example"}, + LI {TOH "just-in-time compilation example"} }@ Subnodes :Examples "fast Fourier transform example" "general linear model example" + "just-in-time compilation example" :Types ForeignFunction SharedLibrary @@ -2262,6 +2264,68 @@ doc /// generalLinearModel(A, B, d) /// +doc /// + Key + "just-in-time compilation example" + Headline + using foreign function calls for computing Fibonacci numbers using JIT + Description + Text + Macaulay2's language is interpreted, which means that in general programs + will run more slowly than programs written in a compiled language like C. + If the speed of a compiled language is desirable, then one option is + @wikipedia "just-in-time compilation"@ (JIT), where we compile some code + at runtime. + + As an example, let's suppose that we would like to compute Fibonacci + numbers using the recursive definition, i.e., for all nonnegative + $n\in\ZZ$, $F_n = n$ if $n < 2$ and $F_n = F_{n-2} + F_{n-1}$ otherwise. + As an algorithm, this is horribly inefficient and has exponential running + time, but it will be useful to illustrate our point. + + We will write two functions. One will be a straight Macaulay2 + implementation: + CannedExample + i2 : fibonacci1 = n -> if n < 2 then n else fibonacci1(n - 1) + fibonacci1(n - 2); + Text + The next will be a function that creates a C source file, compiles it + into a shared library using @HREF{"https://gcc.gnu.org/", "GCC"}@, opens + that library using @TO openSharedLibrary@, calls @TO foreignFunction@ to + create a foreign function, calls that foreign function, and then converts + the output back into a Macaulay2 integer using @TO(value, ForeignObject)@. + CannedExample + i3 : fibonacci2 = n -> ( + dir := temporaryFileName(); + makeDirectory dir; + dir | "/libfib.c" << ////int fibonacci2(int n) + { + if (n < 2) + return n; + else + return fibonacci2(n - 1) + fibonacci2(n - 2); + } + //// << close; + run("gcc -c -fPIC " | dir | "/libfib.c -o " | dir | "/libfib.o"); + run("gcc -shared " | dir | "/libfib.o -o " | dir | "/libfib.so"); + lib := openSharedLibrary("libfib", FileName => dir | "/libfib.so"); + f = foreignFunction(lib, "fibonacci2", int, int); + value f n); + Text + Now let's run both functions to compare the results. + CannedExample + i4 : peek elapsedTiming fibonacci1 35 + + o4 = Time{10.0202, 9227465} + + i5 : peek elapsedTiming fibonacci2 35 + + o5 = Time{.0958821, 9227465} + Text + As we can see, despite the additional overhead of creating a shared + library and making a foreign function call, the function that used JIT was + significantly faster. +/// + TEST /// ----------- -- value -- From fa63b2461afdd7f8f33f88d24d5e1d09673cfcfd Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 6 Sep 2024 13:55:15 -0400 Subject: [PATCH 126/226] Bump ForeignFunctions package to version 0.4 --- M2/Macaulay2/packages/ForeignFunctions.m2 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index 6d1b89bf7de..2e7fcc98f7e 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -18,8 +18,8 @@ newPackage("ForeignFunctions", Headline => "foreign function interface", - Version => "0.3", - Date => "February 8, 2024", + Version => "0.4", + Date => "September 6, 2024", Authors => {{ Name => "Doug Torrance", Email => "dtorrance@piedmont.edu", @@ -33,6 +33,12 @@ newPackage("ForeignFunctions", -* +0.4 (2024-09-06, M2 1.24.11) +* remove redundant Constant methods now that it's a subclass of Number +* further tweak macOS dlopen hack (not just ARM machines) +* license under GPL-2+ +* significant documentation improvements (e.g., subnodes, more examples) + 0.3 (2024-02-08, M2 1.23) * add subscripted assignment for various pointer types * add support for GMP integers and MPFR reals From cb15bd0bfacf92ada65b6d0f6161625c1efaba9d Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 2 Oct 2024 12:18:23 -0400 Subject: [PATCH 127/226] Update date and changelog for v0.4 --- M2/Macaulay2/packages/ForeignFunctions.m2 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/ForeignFunctions.m2 b/M2/Macaulay2/packages/ForeignFunctions.m2 index 2e7fcc98f7e..87198512f25 100644 --- a/M2/Macaulay2/packages/ForeignFunctions.m2 +++ b/M2/Macaulay2/packages/ForeignFunctions.m2 @@ -19,7 +19,7 @@ newPackage("ForeignFunctions", Headline => "foreign function interface", Version => "0.4", - Date => "September 6, 2024", + Date => "October 1, 2024", Authors => {{ Name => "Doug Torrance", Email => "dtorrance@piedmont.edu", @@ -33,11 +33,13 @@ newPackage("ForeignFunctions", -* -0.4 (2024-09-06, M2 1.24.11) +0.4 (2024-10-01, M2 1.24.11) * remove redundant Constant methods now that it's a subclass of Number * further tweak macOS dlopen hack (not just ARM machines) * license under GPL-2+ * significant documentation improvements (e.g., subnodes, more examples) +* update examples to use functions from C standard library to avoid + build errors on systems where we're using mpfr and mps as static libraries 0.3 (2024-02-08, M2 1.23) * add subscripted assignment for various pointer types From c903b992ddaaabf7d8c8cd2b84b45751adff6acb Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 13:21:06 -0700 Subject: [PATCH 128/226] fixed a url --- M2/Macaulay2/packages/NumericalSemigroups.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/NumericalSemigroups.m2 b/M2/Macaulay2/packages/NumericalSemigroups.m2 index 1bcfd34d722..521506c20ac 100644 --- a/M2/Macaulay2/packages/NumericalSemigroups.m2 +++ b/M2/Macaulay2/packages/NumericalSemigroups.m2 @@ -3,7 +3,7 @@ newPackage( Version => "1.0", Date => "October 25, 2024", Headline => "Compute the Apery set and invariants of a numerical semigroup ring", - Authors => {{ Name => "David Eisenbud", Email => "de@berkeley.edu", HomePage => "eisenbud.github.io"}, + Authors => {{ Name => "David Eisenbud", Email => "de@berkeley.edu", HomePage => "http://eisenbud.github.io"}, { Name => "Frank-Olaf Schreyer", Email => "schreyer@math.uni-sb.de", HomePage => "https://www.math.uni-sb.de/ag/schreyer/index.php/publications/publications-frank-olaf-schreyer"}}, AuxiliaryFiles => false, DebuggingMode => false, From 99de95411a3cf0955293ec365e9a1260f1a05758 Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 14:57:10 -0700 Subject: [PATCH 129/226] adding new version of PencilsOfQuadrics.m2 --- M2/Macaulay2/packages/PencilsOfQuadrics.m2 | 775 +++++++++++++++++++-- 1 file changed, 716 insertions(+), 59 deletions(-) diff --git a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 index f9083268fee..78b2f1d1b6a 100644 --- a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 +++ b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 @@ -9,25 +9,26 @@ viewHelp "PencilsOfQuadrics" needsPackage"CompleteIntersectionResolutions" loadPackage("PencilsOfQuadrics", Reload=>true) peek loadedFiles - /// + newPackage( "PencilsOfQuadrics", - Version => "0.9", - Date => "June 17, 2020", + Version => "1.0", + Date => "October 10, 2024", Authors => {{Name => "Frank-Olaf Schreyer", Email => "schreyer@math.uni-sb.de", HomePage => ""}, {Name => "David Eisenbud", Email => "de@msri.org", - HomePage => "https://www.msri.org/~de"}, + HomePage => "www.msri.org/~de"}, {Name => "Yeongrak Kim", - Email => "kim@math.uni-sb.de", - HomePage => "https://sites.google.com/view/yeongrak"} + Email => "yeongrak.kim@pusan.ac.kr", + HomePage => "sites.google.com/view/yeongrak"} }, - PackageExports => {"CompleteIntersectionResolutions"}, + PackageExports => {"CompleteIntersectionResolutions"}, Headline => "Clifford Algebra of a pencil of quadratic forms", - Keywords => {"Commutative Algebra"} + DebuggingMode => false, + Keywords => {"Commutative Algebra", "Algebraic Geometry"} ) export { @@ -36,9 +37,9 @@ peek loadedFiles "RandomNicePencil", "cliffordOperators",-- "centers",-- - -- "tensorProduct", - "randomLineBundle", + "preRandomLineBundle", -- methods updated in ver 1.0 + "randomLineBundle", -- methods updated in ver 1.0 -- "Nontrivial", -- an option which is not used in ver 0.2 "degOnE", -- "degreeOnE", @@ -75,9 +76,10 @@ peek loadedFiles "VectorBundleOnE", "vectorBundleOnE", "yAction", - "searchUlrich", + "searchUlrich", -- methods updated in ver 1.0 "translateIsotropicSubspace", - "randomIsotropicSubspace" + "randomIsotropicSubspace", + "LabBookProtocol", } needsPackage"CompleteIntersectionResolutions" @@ -94,6 +96,319 @@ CliffordModule = new Type of MutableHashTable VectorBundleOnE = new Type of MutableHashTable RandomNicePencil = new Type of MutableHashTable +LabBookProtocol=method() +LabBookProtocol(ZZ) := (g) -> ( + if g==3 then ( + print " + g=3 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 0.644455 seconds elapsed + M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + elapsedTime while ( + m1=randomLineBundle(g+(g%2),f); + m2=randomLineBundle(g%2,f); + m12=randomExtension(m1.yAction,m2.yAction); + V = vectorBundleOnE m12; + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 0.337555 seconds elapsed + betti Ul.yAction, betti Ul1.yAction + --further commands + elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 9.35977 seconds elapsed + M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + r=2 + Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + Ulr=coker map(S^(r*2^g),,Ulrich); + minimalBetti Ulr + -- will give an Ulrich bundle, with betti table + -- 16 32 16") + else + if g==4 then ( print " + g=4 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 9.29588 seconds elapsed + M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + elapsedTime while ( + m1=randomLineBundle(g+(g%2),f); + m2=randomLineBundle(g%2,f); + m12=randomExtension(m1.yAction,m2.yAction); + V = vectorBundleOnE m12; + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 2.27561 seconds elapsed + betti Ul.yAction, betti Ul1.yAction + --further commands + elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 419.895 seconds elapsed + M1Ul:=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + r=2 + Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + Ulr=coker map(S^(r*2^g),,Ulrich); + minimalBetti Ulr + -- will give an Ulrich bundle, with betti table + -- 32 64 32 + ") else + if g==5 then ( print " + g=5 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 56.2955 seconds elapsed + elapsedTime M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + elapsedTime while ( + m1=randomLineBundle(g+(g%2),f); + m2=randomLineBundle(g%2,f); + m12=randomExtension(m1.yAction,m2.yAction); + V = vectorBundleOnE m12; + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 29.9208 seconds elapsed + betti Ul.yAction, betti Ul1.yAction + -- -- the further commands + -- Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- add timing + -- M1Ul:=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + -- r=2 + -- Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + -- Ulr=coker map(S^(r*2^g),,Ulrich) + -- minimalBetti Ulr + -- -- will give an Ulrich bundle, with betti table + -- 64 128 64 + ") + else (print "no record") + ) + +LabBookProtocol(ZZ,ZZ) := (g,r) -> ( + if (g,r)==(2,3) then ( + print " + g=2 + r=3 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 0.1028558 seconds elapsed + P=kk[drop(gens S,-2)] + gens P + M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + degSeq={0,1,2} + elapsedTime while ( + -- build a vector bundle V as extensions of line bundles of degrees in degSeq + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 0.181415 seconds elapsed + betti Ul.yAction,betti Ul1.yAction + --further commands + elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 1.15852 seconds elapsed + M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + Ulrich = coker map(P^(r*2^g),,sub(M1Ul^{r*2^g..(2*r)*2^g-1},P)); + minimalBetti Ulrich + -- Is an Ulrich bundle, with betti numbers + -- r*2^g,(2*r)*2^g,r*2^g + elapsedTime qs=ann Ulrich + ideal sub(diff((vars S)_{2*g+2,2*g+3},qq),P)==qs + ") else + if (g,r)==(3,4) then ( print " + g=3 + r=4 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 0.623928 seconds elapsed + P=kk[drop(gens S,-2)] + gens P + M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + degSeq={1,2,3,4} + elapsedTime while ( + -- build a vector bundle V as extensions of line bundles of degrees in degSeq + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 1.15312 seconds elapsed + betti Ul.yAction,betti Ul1.yAction + --further commands + elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 87.5896 seconds elapsed + M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + Ulrich = coker map(P^(r*2^g),,sub(M1Ul^{r*2^g..(2*r)*2^g-1},P)); + minimalBetti Ulrich + -- Is an Ulrich bundle, with betti numbers + -- r*2^g,(2*r)*2^g,r*2^g + elapsedTime qs=ann Ulrich + -- 25.3661 seconds elapsed + ideal sub(diff((vars S)_{2*g+2,2*g+3},qq),P)==qs + ") else + if (g,r)==(4,3) then ( print " + g=4; + r=3; + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 9.41219 seconds elapsed + elapsedTime M=cliffordModule(Mu1,Mu2,R) + P=kk[drop(gens S,-2)]; + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + degSeq={0,2,4} + elapsedTime while ( + -- build a vector bundle V as extensions of line bundles of degrees in degSeq + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 7.34427 seconds elapsed + betti Ul.yAction,betti Ul1.yAction + --further commands + -- elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 1814.76 seconds elapsed + -- M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + -- Ulrich = coker map(P^(r*2^g),,sub(M1Ul^{r*2^g..(2*r)*2^g-1},P)); + -- minimalBetti Ulrich + -- Is an Ulrich bundle, with betti numbers + -- r*2^g,(2*r)*2^g,r*2^g + -- elapsedTime qs=ann Ulrich + -- 522.132 seconds elapsed + -- ideal sub(diff((vars S)_{2*g+2,2*g+3},qq),P)==qs + ") + else (print "no record") + ) + +/// +LabBookProtocol 3 +LabBookProtocol 4 +LabBookProtocol 5 + g=5 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 56.2955 seconds elapsed + elapsedTime M=cliffordModule(Mu1,Mu2,R) + -- 12.8458 seconds elapsed + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + elapsedTime while ( + m1=randomLineBundle(g+(g%2),f); + m2=randomLineBundle(g%2,f); + m12=randomExtension(m1.yAction,m2.yAction); + V = vectorBundleOnE m12; + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 29.9208 seconds elapsed + betti Ul.yAction, betti Ul1.yAction + -- -- the further commands + -- elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- + -- M1Ul:=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + -- r=2 + -- Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + -- Ulr=coker map(S^(r*2^g),,Ulrich) + -- minimalBetti Ulr + -- -- will give an Ulrich bundle, with betti table + -- 64 128 64 + +LabBookProtocol 6 +LabBookProtocol(2,3) +LabBookProtocol(3,4) + +LabBookProtocol(4,3) + g=4; + r=3; + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 9.41219 seconds elapsed + elapsedTime M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + degSeq={0,2,4} + elapsedTime while ( + -- build a vector bundle V as extensions of line bundles of degrees in degSeq + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 7.34427 seconds elapsed + betti Ul.yAction,betti Ul1.yAction + --further commands + --elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- add timing + --M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + --Ulrich = coker map(P^(r*2^g),,sub(M1Ul^{r*2^g..(2*r)*2^g-1},P)); + --minimalBetti Ulrich + -- Is an Ulrich bundle, with betti numbers + -- r*2^g,(2*r)*2^g,r*2^g + --elapsedTime qs=ann Ulrich + -- + --ideal sub(diff((vars S)_{2*g+2,2*g+3},qq),P)==qs + +/// + matrixFactorizationK=method() matrixFactorizationK(Matrix,Matrix) := (X,Y) -> ( @@ -164,7 +479,7 @@ randomNicePencil(Ring,ZZ) := (kk,g) -> ( X -- is the irrelevant ideal of PP^(2g+1) Y -- Y is the coefficient vector of qq written as a linear combination of X assert(X*transpose Y==qq) - u -- are the linear equations defining a maximal isotropic subspace + u -- are the linear equations defining a maximal isotropic saubspace betti M1, betti M2 -- is the matrix factorization of qq -- corresponding to the resolution of kk betti Mu1, betti Mu2 -- is the matrix factorization of qq @@ -342,7 +657,6 @@ assert(c0^2-(-1)^d*determ*id_(target c0)==0) assert(c1^2-(-1)^d*determ*id_(source c1)==0) /// - factorToList = method() factorToList(Product) := pf ->( lpf := toList pf; @@ -354,9 +668,10 @@ factorToList(Product) := pf ->( assert (f == product factorToList factor f) /// --randomLineBundle=method(Options => {Nontrivial =>true}) -randomLineBundle=method() + +preRandomLineBundle=method() -- the option is not used -randomLineBundle( RingElement ) := f -> ( +preRandomLineBundle( RingElement ) := f -> ( --produces a 2x2 matrix factorization of f, hence a line bundle on the hyperelliptic curve. --corresponding to y^2-(-1)^g*f. --the first matrix has the form @@ -376,8 +691,93 @@ randomLineBundle( RingElement ) := f -> ( m:=map(targetm,, matrix{{b,c},{a,-b}}); assert(isHomogeneous m); vectorBundleOnE m + + -- an output of this method will be mostly unbalanced -- deg(a) and deg(c) may have a big gap. + -- in the case, the corresponding line bundle will lie on a (twisted) theta divisor (or a Brill-Noether loci) + -- so we need a method to find a "general" one by tensoring a number of degree 0 line bundles ) +preRandomLineBundle(ZZ,RingElement) := (d,f) -> ( +-- f a binary form of degree 2g+2 over a finite field +-- d an integer +-- select randomly a line L of degree d on the hyperelliptic curve +-- defined by y^2-(-1)^g*f + while (L:=preRandomLineBundle f; a:=d-degOnE L; a%2 !=0) do (); + R:= ring f; + Ld := vectorBundleOnE (L.yAction**R^{-a//2}); + if d == 0 then + while (member({0},degrees target Ld.yAction)) do( + Ld = preRandomLineBundle (d,f); + ); + Ld +) + +randomLineBundle=method() +randomLineBundle(RingElement) := (f) -> ( +-- Input +-- f: a binary form of degree 2g+2 over a finite field + +-- Output : a (much more balanced) random line bundle of degree d on the corresponding hyperelliptic curve. + if ((# gens ring f) != 2 or ((degree f)_0)%2 !=0) then error "f should be a binary form of degree 2g+2"; + if (char ring f)==0 then error "define f over a finite field"; + + g:=(degree f)_0 // 2 - 1; + Ld := preRandomLineBundle(f); + + for i from 1 to g-1 do( + L0 := preRandomLineBundle(0,f); + Ld = tensorProduct(Ld,L0); + ); + Ld + ) + +randomLineBundle(ZZ, RingElement) := (d,f) -> ( +-- Input +-- d: an integer +-- f: a binary form of degree 2g+2 over a finite field + +-- Output : a (much more balanced) random line bundle of degree d on the corresponding hyperelliptic curve. + if ((# gens ring f) != 2 or ((degree f)_0)%2 !=0) then error "f should be a binary form of degree 2g+2"; + if (char ring f)==0 then error "define f over a finite field"; + + g:=(degree f)_0 // 2 - 1; + Ld := preRandomLineBundle(d,f); + + for i from 1 to g-1 do( + L0 := preRandomLineBundle(0,f); + Ld = tensorProduct(Ld,L0); + ); + Ld + ) + + +TEST/// +--test of preRandomLineBundle and randomLineBundle +restart +load "PencilsOfQuadrics.m2" +kk = ZZ/nextPrime(10^3) +R = kk[ s,t] +g = 3 + +f = random(2*g+2, R) +assert(dim ideal(jacobian ideal f)== 0) + +d=random(ZZ) + +tally apply(100, i->( +preLd=preRandomLineBundle(d,f); +betti preLd.yAction)) + +tally apply(100, i->( +Ld=randomLineBundle(d,f); +betti Ld.yAction)) + + + +/// + + + --randomMatrixFactorization = method(Options => {Nontrivial =>true}) randomMatrixFactorization=method() randomMatrixFactorization(RingElement) := f -> ( @@ -450,20 +850,7 @@ orderInPic(VectorBundleOnE) := L->( if numrows M != 2 or degOnE L != 0 then error("expected bundle to have rank 1 and degree 0"); orderInPic M) -randomLineBundle(ZZ,RingElement) := (d,f) -> ( --- f a binary form of degree 2g+2 over a finite field --- d an integer --- select randomly a line L of degree d on the hyperelliptic curve --- defined by y^2-(-1)^g*f - while (L:=randomLineBundle f; a:=d-degOnE L; a% 2 !=0) do (); - R:= ring f; - Ld := vectorBundleOnE (L.yAction**R^{-a//2}); - if d == 0 then - while (member({0},degrees target Ld.yAction)) do( - Ld = randomLineBundle (d,f); - ); - Ld - ) + /// -- Experiments on the order of Pic^0 of an elliptic curve over a finite field @@ -911,20 +1298,153 @@ searchUlrich(CliffordModule,Ring) :=(M,S) -> ( coker map(S^(2^(g+1)),,Ulrich) ) + + +searchUlrich(CliffordModule,Ring,ZZ) := (M,S,r) ->( + -- Input + -- r: integer at least 2 + -- M: a Clifford Module associated to a pencil of quadrics in PP^(2g+1) + -- S: associated ring of polynomials (2g+2 variables for PP^(2g+1), and two variables s, t for parametrizing the pencil of quadrics) + + -- Output: an Ulrich module of rank r*2^(g-2) + + -- By Riemann-Roch, we need a rank r vector bundle E of degree r(g-2)/2, or a twist by a line bundle + -- so we are tempting to find a rank r, degree rg/2 vector bundle by extensions of r line bundles. + + Mor := vectorBundleOnE M.evenCenter; + Mor1:= vectorBundleOnE M.oddCenter; + f := M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + + g:=degree ideal f//2-1; + if (numgens S != 2*g+4) then error "S should be a polynomial ring in (2g+4) variables"; + if (rank source M.evenCenter != 2^(g+1)) then error "M should be a Clifford module associated to a maximal isotropic subspace"; + + if (r <= 1) then error "r should be at least 2"; + if ((r*g)%2 != 0) then error "either r or g should be even"; + + m1:=null; m2:= null; m12 := null; + Ul:= null; Ul1:= null; V:= null; + d1 := null; d0:= null; + + d:=g%2; + + -- build up a nondecreasing sequence begin with d, end with d+g, and their sum is an expected degree, and is balanced as possible as it can + targetSum := (r*g)//2 + d*r; + degSeq := apply(r, i-> d + floor(g*i/(r-1))); + delta := targetSum - sum degSeq; + mutSeq := new MutableList from degSeq; + + -- adjust the sequence + searchIndex:=1; -- start from the second element + while (delta > 0) do ( + if (searchIndex >= r-1) then searchIndex=1; + if (mutSeq#searchIndex < mutSeq#(searchIndex+1)) then (mutSeq#searchIndex = mutSeq#searchIndex+1; delta=delta-1; searchIndex=1;) else searchIndex=searchIndex+1; + ); + + degSeq=toList mutSeq; + assert( degSeq#0 == d and degSeq#(r-1) == d+g and (sum degSeq == targetSum)); + + while ( + -- build a vector bundle V as extensions of line bundles of degrees in degSeq + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + + #d1 >=3 or #d0 >=3) do (); + + Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + M1Ul:=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + coker map(S^(r*2^g),,Ulrich) +) + /// restart load "PencilsOfQuadrics.m2" -kk=ZZ/101 +kk=ZZ/nextPrime(10^3) R=kk[s,t] + g=3 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); M=cliffordModule(Mu1,Mu2,R) -elapsedTime Ulrich = searchUlrich(M,S); -betti res Ulrich -ann Ulrich + +r=4 +time rUlrich=searchUlrich(M,S,r); +minimalBetti rUlrich +time ann rUlrich == ideal( sub(qq,{S_(2*g+2)=>1,S_(2*g+3)=>0}), sub(qq,{S_(2*g+2)=>0,S_(2*g+3)=>1})) + + +g=6; +r=3; -- looking for Ulrich of rank r*2^(g-1) +time (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); -- when g>4 it becomes heavy! +-- used 461.086 seconds +time M=cliffordModule(Mu1,Mu2,R) +-- used 101.41 seconds + +Mor = vectorBundleOnE M.evenCenter; +Mor1= vectorBundleOnE M.oddCenter; +f = M.hyperellipticBranchEquation; +d=g%2; + + -- build up a nondecreasing sequence begin with d, end with d+g, and their sum is an expected degree, and is balanced as possible as it can + targetSum = (r*g)//2 + d*r; + degSeq = apply(r, i-> d + floor(g*i/(r-1))); + delta = targetSum - sum degSeq; + mutSeq = new MutableList from degSeq; + + -- adjust the sequence + searchIndex=1; -- start from the second element + while (delta > 0) do ( + if (searchIndex >= r-1) then searchIndex=1; + if (mutSeq#searchIndex < mutSeq#(searchIndex+1)) then (mutSeq#searchIndex = mutSeq#searchIndex+1; delta=delta-1; searchIndex=1;) else searchIndex=searchIndex+1; + ); + + degSeq=toList mutSeq + + time tally apply(1, j->( -- number of trials=1 + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + + (betti Ul.yAction, betti Ul1.yAction) + )) + +-- computing the actions of generators is very heavy, but by this part the computation is promising +-- for instance, (g,r) = (6,3) takes + +-* + -- used 815.548 seconds + + 0 1 0 1 +o915 = Tally{(total: 384 384, total: 384 384) => 1} + -6: 192 . -4: 384 . + -5: 192 . -3: . . + -4: . . -2: . . + -3: . . -1: . . + -2: . . 0: . . + -1: . . 1: . . + 0: . 192 2: . 384 + 1: . 192 + +*- + +-- which is believed to be inducing an Ulrich bundle of rank r*2^(g-2). -assert(4*2^(g-1)== numrows presentation Ulrich) -* M=cliffordModule(Mu1,Mu2,R) @@ -1338,7 +1858,7 @@ ExtIntoK(Ideal, Module) := (I,M) -> ( -- algebra over --a polynomial subring T (eg R = k[s,t][x_0...x_n]/s*q1(x)+t*q2(x)) --and I is an ideal such that T = R/I, - --the script returns + --the scritp returns --Ext^*(M,R/I) --graded in POSITIVE degrees --as a module over T[X_0...X_c] @@ -1415,6 +1935,7 @@ document { }, SUBSECTION "Vector Bundles", UL{ + TO preRandomLineBundle, -- kk has to be finite TO randomLineBundle, -- kk has to be finite TO vectorBundleOnE, TO yAction, @@ -1434,7 +1955,8 @@ document { UL{ TO translateIsotropicSubspace, TO randomIsotropicSubspace, -- kk has to be finite - TO searchUlrich -- kk has to be finite + TO searchUlrich, -- kk has to be finite + TO LabBookProtocol } } @@ -1450,7 +1972,7 @@ doc /// X:Matrix row matrix of linear forms with constant coefficients Y:Matrix - row matrix of linear forms with linear coefficients of same length as X + row matrix of linear forms with linear coefficents of same length as X Outputs M1:Matrix M2:Matrix @@ -1626,11 +2148,11 @@ doc /// The variables of S that are entries of X:= matrix \{\{x_0..y_{(g-1)},z_1,z_2\}\} \, represent coordinates on PP_R^{2g+1}. - M1, M2 are consecutive high syzygy matrices in the minimal (periodic) resolution + M1, M2 are consecutive high syzygy matrices in the miminal (periodic) resolution of kk[s,t] = S/(ideal X) as a module over S/qq. These are used to construct the Clifford algebra of qq. - Mu1, Mu2 are consecutive high syzygy matrices in the minimal (periodic) resolution + Mu1, Mu2 are consecutive high syzygy matrices in the miminal (periodic) resolution of S/(ideal u) as a module over S/qq. These are used to construct a Morita bundle between the even Clifford algebra of qq and the hyperelliptic curve branched over the degeneracy locus of the pencil, @@ -1707,7 +2229,7 @@ doc /// polynomial ring of the form kk[U], where U are parameter variables M1:Matrix - over an auxiliary ring S = kk[X,Y,Z,U] + over an auxilliary ring S = kk[X,Y,Z,U] M2:Matrix M1, M2 a matrix factorization: M1*M2- qq*id = 0 for a quadratic form qq on S Outputs @@ -1726,7 +2248,7 @@ doc /// We have eOdd_i*eEv_j+eOdd_j*eEv_i = B(e_i,e_j), where the e_i form a basis of the space on which qq acts and B is the bilinear form associated to 2qq - thus the pairs (eOd_i,eEv_i) form a representation of Cliff(qq). + thus the the pairs (eOd_i,eEv_i) form a representation of Cliff(qq). --If qq is nonsingular over the generic point of R, then C is an Azumaya algebra over R, and this implies that the representation is faithful. In the following we construct the generic symmetric @@ -2044,7 +2566,7 @@ doc /// polynomial ring kk[s,t] Description Text - The base ring kk[s,t] which is the coordinate ring of PP^1. + The base ring kk[s,t] which is the coordnate ring of PP^1. Example kk=ZZ/101; g=1; @@ -2474,7 +2996,7 @@ doc /// Text A vector bundle on a hyperelliptic curve E with equation y^2 - (-1)^g * f - can be represented by it's pushforward V to PP^1, + can be represeted by it's pushforward V to PP^1, under the degree 2 map, which will be a vector bundle of twice the rank, together with a matrix @@ -2698,14 +3220,14 @@ doc /// doc /// Key - randomLineBundle - (randomLineBundle,RingElement) - (randomLineBundle,ZZ,RingElement) + preRandomLineBundle + (preRandomLineBundle,RingElement) + (preRandomLineBundle,ZZ,RingElement) Headline a random line bundle on the hyperelliptic curve Usage - L=randomLineBundle(f) - Ld=randomLineBundle(d,f) + L=preRandomLineBundle(f) + Ld=preRandomLineBundle(d,f) Inputs f : RingElement the hyperelliptic branch equation of a CliffordModule. @@ -2731,9 +3253,7 @@ doc /// whose determinant equals to (-1)^{g}*f. We find such a matrix over a finite ground field by picking randomly b, a homogeneous form of degree (g+1), since the binary form b^2 + (-1)^{g}*f frequently factors. - - - + Example kk=ZZ/101; g=1; @@ -2741,12 +3261,12 @@ doc /// cM=cliffordModule(rNP.matFact1,rNP.matFact2,rNP.baseRing); f=cM.hyperellipticBranchEquation - L=randomLineBundle(f) + L=preRandomLineBundle(f) degOnE L m=L.yAction (m)^2_(0,0)+(-1)^g*f==0 - L0=randomLineBundle(0,f) + L0=preRandomLineBundle(0,f) degOnE L0 orderInPic L0 @@ -2757,6 +3277,60 @@ doc /// VectorBundleOnE degOnE orderInPic + randomLineBundle +/// + +doc /// + Key + randomLineBundle + (randomLineBundle,RingElement) + (randomLineBundle,ZZ,RingElement) + Headline + a random balanced line bundle on the hyperelliptic curve + Usage + L=randomLineBundle(f) + Ld=randomLineBundle(d,f) + Inputs + f : RingElement + the hyperelliptic branch equation of a CliffordModule. + d : ZZ + Outputs + L : VectorBundleOnE + a line bundle on E + Ld : VectorBundleOnE + a line bundle on E of degree d. + Description + Text + Chooses a random line bundle on the hyperelliptic curve E of genus g + given by the equation y^2-(-1)^{g}*f, where f is the branch equation of degree + (2g+2). Input with an integer d gives a random line bundle of degree d on E. + + Note that the method preRandomLineBundle mostly constructs an unbalanced line bundle, that is, + the degrees of a and c for the determinantal representation of (-1)^{g}*f have a big gap. + Such a line bundle will be contained in the theta divisor (after a certain twist), so we make it into a balanced line bundle + by tensoring degree 0 line bundles. + + + Example + kk=ZZ/1009; + g=2; + rNP=randNicePencil(kk,g); + cM=cliffordModule(rNP.matFact1,rNP.matFact2,rNP.baseRing); + + f=cM.hyperellipticBranchEquation + + tally apply(30, i->(Lp=preRandomLineBundle(1,f); betti Lp.yAction)) + + tally apply(30, i->(L=randomLineBundle(1,f); betti L.yAction)) + + Caveat + The ground field kk has to be finite. + SeeAlso + preRandomLineBundle + vectorBundleOnE + VectorBundleOnE + degOnE + orderInPic /// doc /// @@ -2805,7 +3379,6 @@ doc /// degOnE /// ---YK doc /// Key cliffordModuleToMatrixFactorization @@ -2935,17 +3508,21 @@ doc /// Key searchUlrich (searchUlrich, CliffordModule, Ring) + (searchUlrich, CliffordModule, Ring, ZZ) Headline - searching an Ulrich module of smallest possible rank + searching an Ulrich module of smallest possible rank, or an Ulrich module of given rank. Usage Ulr = searchUlrich(M,S) + Ulr = searchUlrich(M,S,r) Inputs M : CliffordModule S : Ring - a polynomial ring in x_0..y_{(g-1)},z_1,z_2,s,t + a polynomial ring in x_0..y_(g-1),z_1,z_2,s,t + r : ZZ + an integer greater than 1, either g or r is even Outputs Ulr : Module - a module on S supported on x_0..y_{(g-1)},z_1,z_2 + a module on S supported on x_0..y_(g-1),z_1,z_2 Description Text M is assumed to be a Clifford module with a Morita bundle F_u, i.e., associated to a @@ -2962,6 +3539,11 @@ doc /// searchUlrich looks for a candidate G of rank 2 on E and returns a module on S supported on a CI V(q_1,q_2) \subset PP^{2g+1}. + + When r is indicated, searchUlrich looks for a candidate G of rank r on E and returns a module on S + supported on a CI V(q_1,q_2) \subset PP^{2g+1}. + + Example kk=ZZ/101; g=2; @@ -2977,12 +3559,87 @@ doc /// elapsedTime Ulr = searchUlrich(M,S); betti res Ulr ann Ulr == ideal qs + + elapsedTime Ulr3 = searchUlrich(M,S,3); + betti res Ulr3 + ann Ulr3 == ideal qs Caveat - searchUlrich uses the method randomLineBundle, so the ground field kk has to be finite. + searchUlrich uses the method randomLineBundle, so the ground field kk has to be finite. SeeAlso cliffordModule + LabBookProtocol +/// + +doc /// + Key + LabBookProtocol + (LabBookProtocol,ZZ) + (LabBookProtocol,ZZ,ZZ) + Headline + Print commands that lead to a construction of a Ulrich bundle + Usage + S = LabBookProtocol(g) + S = LabBookProtocol(g,r) + Inputs + g:ZZ + genus of the associated hyperelliptic curve E. + r:ZZ + rank of the vextor bundle E + Outputs + S:String + of commands which would produce an Ulrich bundle on X + Description + Text + Our function searchUlrich produces Ulrich bundles of rank r + in principle. However some of the computation take lot of time. + We break this approach for small (g,r) into parts + and protocol the commande and the timings. + Example + g=3 + LabBookProtocol(g) + + g=3 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 0.644455 seconds elapsed + M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + elapsedTime while ( + m1=randomLineBundle(g+(g%2),f); + m2=randomLineBundle(g%2,f); + m12=randomExtension(m1.yAction,m2.yAction); + V = vectorBundleOnE m12; + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 0.337555 seconds elapsed + betti Ul.yAction, betti Ul1.yAction + --further commands + elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 9.35977 seconds elapsed + M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + r=2 + Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + Ulr=coker map(S^(r*2^g),,Ulrich); + minimalBetti Ulr + -- will give an Ulrich bundle, with betti table + -- 16 32 16 + + (g,r)=(3,4) + LabBookProtocol(g,r) + SeeAlso + searchUlrich + RandomNicePencil + tensorProduct + randomLineBundle /// + doc /// Key translateIsotropicSubspace From 48d9ae44f26f9559c2952523fe0e05d78671bb00 Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 15:03:01 -0700 Subject: [PATCH 130/226] fixed spelling in Pencils.. --- M2/Macaulay2/packages/PencilsOfQuadrics.m2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 index 78b2f1d1b6a..44cce1ab38e 100644 --- a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 +++ b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 @@ -1858,7 +1858,7 @@ ExtIntoK(Ideal, Module) := (I,M) -> ( -- algebra over --a polynomial subring T (eg R = k[s,t][x_0...x_n]/s*q1(x)+t*q2(x)) --and I is an ideal such that T = R/I, - --the scritp returns + --the script returns --Ext^*(M,R/I) --graded in POSITIVE degrees --as a module over T[X_0...X_c] @@ -1972,7 +1972,7 @@ doc /// X:Matrix row matrix of linear forms with constant coefficients Y:Matrix - row matrix of linear forms with linear coefficents of same length as X + row matrix of linear forms with linear coefficients of same length as X Outputs M1:Matrix M2:Matrix @@ -2148,11 +2148,11 @@ doc /// The variables of S that are entries of X:= matrix \{\{x_0..y_{(g-1)},z_1,z_2\}\} \, represent coordinates on PP_R^{2g+1}. - M1, M2 are consecutive high syzygy matrices in the miminal (periodic) resolution + M1, M2 are consecutive high syzygy matrices in the minimal (periodic) resolution of kk[s,t] = S/(ideal X) as a module over S/qq. These are used to construct the Clifford algebra of qq. - Mu1, Mu2 are consecutive high syzygy matrices in the miminal (periodic) resolution + Mu1, Mu2 are consecutive high syzygy matrices in the minimal (periodic) resolution of S/(ideal u) as a module over S/qq. These are used to construct a Morita bundle between the even Clifford algebra of qq and the hyperelliptic curve branched over the degeneracy locus of the pencil, @@ -2229,7 +2229,7 @@ doc /// polynomial ring of the form kk[U], where U are parameter variables M1:Matrix - over an auxilliary ring S = kk[X,Y,Z,U] + over an auxiliary ring S = kk[X,Y,Z,U] M2:Matrix M1, M2 a matrix factorization: M1*M2- qq*id = 0 for a quadratic form qq on S Outputs From a61b4a473b55559c3947ffeca8fae708e1bcd51a Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Wed, 23 Oct 2024 20:42:22 -0400 Subject: [PATCH 131/226] Added code for computing superpotentials of m-Koszul AS regular algebras, as well as code for creating derivation-quotient algebras defined from a superpotential. --- M2/Macaulay2/packages/AssociativeAlgebras.m2 | 197 ++++++++++++++++--- 1 file changed, 174 insertions(+), 23 deletions(-) diff --git a/M2/Macaulay2/packages/AssociativeAlgebras.m2 b/M2/Macaulay2/packages/AssociativeAlgebras.m2 index dc282630312..e2c7175c76d 100644 --- a/M2/Macaulay2/packages/AssociativeAlgebras.m2 +++ b/M2/Macaulay2/packages/AssociativeAlgebras.m2 @@ -1,7 +1,7 @@ newPackage( "AssociativeAlgebras", - Version => "0.8", - Date => "21 Jan 2021", + Version => "0.9", + Date => "23 Oct 2024", Authors => {{Name => "Frank Moore", Email => "moorewf@wfu.edu", HomePage => "https://math.wfu.edu/moore"}, @@ -13,7 +13,8 @@ newPackage( Keywords => {"Noncommutative Algebra"}, PackageImports =>{"Complexes"}, PackageExports =>{"IntegralClosure"}, - AuxiliaryFiles => true + AuxiliaryFiles => true, + DebuggingMode => true ) -- TODO for tbb update: (Dec 2021) @@ -24,7 +25,7 @@ newPackage( -- run multithreaded tests for NCF4 and mgb to make sure they are actually getting speedups. -- add in the arena stuff? Jay's pull request to mathicgb -- (We would need to make the same changes for M2 usage, i.e. NCF4). --- + ---- Warning!! This package is a current work in progress. ---- The interface will change (even basic things like Groebner bases and the basis command) ---- and more functionality is expected to be added. @@ -106,7 +107,12 @@ export { "ncMatrixMult", "rightKernel", "Derivation", - "derivation" + "derivation", + "superpotential", + "nakayamaAut", + "isSuperpotential", + "derivationQuotientIdeal", + "derivationQuotient" -- "forceNCBasis" -- not exported yet } @@ -1462,6 +1468,160 @@ rightKernel Matrix := opts -> M -> ( result ) +------------------------------------------------------ +--- superpotential code +------------------------------------------------------ + +superpotential = method(Options => {Strategy => "F4"}) +superpotential FreeAlgebraQuotient := opts -> B -> ( + -- compute the relations of the Koszul dual out to degree d+e-1 + -- d = number of generatos of the algebra + -- e = relation degree + A := ambient B; + kk := coefficientRing A; + e := first degree first (ideal B)_*; + koszI := homogDual ideal B; + d := numgens B; + koszIgb := NCGB(koszI,d+e-1,Strategy => opts.Strategy); + koszB := A/koszI; + + -- compute a basis of the Koszul dual + allBasis := flatten apply(d+e, i -> flatten entries ncBasis(i,koszB)); + + -- find a generator of the 'top' degree of the Koszul dual + topDeg := max apply(allBasis, m -> first degree m); + topForm := ncBasis(topDeg,koszB); + if numcols topForm != 1 then error "Expected (m)-Koszul AS-regular algebra."; + + deg1Basis := flatten entries ncBasis(1,A); + -- phi is the projection map from A to koszB + phi := map(koszB,A,gens koszB); + + -- basis of the entire tensor algebra in the 'correct degree' + bigBasis := ncBasis(topDeg,A); + + -- project the basis of the tensor algebra to the koszul dual to get a coefficient from the top form + -- and take the sum of the basis with these coeffs as the superpotential + first flatten entries (bigBasis * (transpose sub(last coefficients(phi bigBasis, Monomials=>topForm),kk))) +) + +--- B = k[x,y,z] +--- koszB = k/(xy+yx,xz+zx,yz+zy,x^2,y^2,z^2) +--- xyz is a basis of the top form in koszB +--- A = k +--- a basis of A in degree 3 is (27 terms) +--- xyz xzy yxz yzx zxy zyx +--- xyz -xyz -xyz xyz xyz -xyz +--- this gives coeffs: +--- xyz - xzy - yxz + yzx + zxy - xyz + +isSuperpotential = method() +isSuperpotential RingElement := f -> ( + X := matrix entries transpose splitElement f; + if rank X != numcols X then return false; + Y := matrix entries transpose splitElement cycleElement f; + if rank Y != numcols Y then return false; + P := (Y // X); + return ((Y - X*P) == 0); +) + +-- cycle from right to left +cycleElement = method() +cycleElement RingElement := f -> ( + varList := toVariableList f; + monLen := #(last first varList); + sum apply(varList, p -> p#0*((p#1)#(monLen-1))*product(drop(p#1,-1))) +) + +splitElement = method() +splitElement RingElement := f -> ( + A := ring f; + kk := coefficientRing A; + d := first degree f; + basis1 := flatten entries ncBasis(1,A); + basisrest := flatten entries ncBasis(d-1,A); + matrix apply(basis1, x -> apply(basisrest, m -> sub(first flatten entries last coefficients(f,Monomials=>matrix {{x*m}}),kk))) +) + +nakayamaAut = method(Options => options superpotential) +nakayamaAut FreeAlgebraQuotient := opts -> B -> ( + sp := superpotential(B,opts); + X := matrix entries transpose splitElement sp; + Y := matrix entries transpose splitElement cycleElement sp; + -- should multiply by (-1)^(gldim + 1) here, but this is expensive to compute and should be known by the user. + -- the map P defined below should satify X = YP where Y is the matrix after cycling + -- and X is the matrix representation of the original superpotential. + P := (X // Y); + -- if the algebra is quadratic, mult by (-1)^(word length sp + 1) + -- if the algebra is cubic, mult by (-1)^(word length sp) + f := first (ideal B)_*; + degf := #(last first (toVariableList f)); + spWL := #(last first (toVariableList sp)); + P = (-1)^(if degf == 2 then spWL + 1 else spWL)*P^(-1); + -- cycling from right to left gives the inverse of the Nakayama automorphism + map(B,B,flatten entries (P*(transpose ncBasis(1,B)))) +) + +nakayamaAut RingElement := opts -> sp -> ( + A := ring sp; + X := matrix entries transpose splitElement sp; + Y := matrix entries transpose splitElement cycleElement sp; + P := (Y // X); + -- for the superpotential version, we assume that sp will give a quadratic algebra + -- (this gives the right answer also in the only other known case + -- of m-Koszul AS-regular algebra, namely m = 3 of gldim 3 on 2 generators + spWL := #(last first (toVariableList sp)); + P = (-1)^(spWL + 1) * P^(-1); + map(A,A,flatten entries (P*(transpose ncBasis(1,A)))) +) + +leftDiff = method() +leftDiff (RingElement, RingElement) := (w,v) -> ( + -- this function selects those monomials from w that start with the + -- variable v, delete v from the monomial and keep the coefficient. + if #(terms v) != 1 then error "Expected a monomial in second argument."; + curElt := w; + diffList := last first toVariableList v; + for var in diffList do ( + curElt = sum for p in toVariableList curElt list ( + if first p#1 == var then (p#0) * (product drop(p#1,1)) else 0 + ); + if curElt == 0 then return 0; + ); + curElt +) + +derivationQuotientIdeal = method() +derivationQuotientIdeal (RingElement, ZZ) := (w,n) -> ( + -- this method defines the derivation-quotient ideal + -- of dubois-violette corresponding to w. It is not verified + -- that w is a superpotential. n derivatives (deletions) are taken on the left. + if not isHomogeneous w then error "Expected a homogeneous input."; + A := ring w; + baseA := coefficientRing A; + d := first degree w; + nBasis := flatten entries ncBasis(n,A); + diffs := apply(nBasis, m -> leftDiff(w,m)); + -- The code below was to create a minimal set of generators of the defining + -- ideal, but in retrospect I think its best to just leave the gens as is. + --basisA := ncBasis(d-n,A); + --coeffs := sub(last coefficients(matrix{diffs}, Monomials => basisA),baseA); + --idealGens := flatten entries (basisA*(mingens image coeffs)); + --ideal idealGens + --result := flatten entries (basisA * coeffs); + --error "err"; + ideal diffs +) + +derivationQuotient = method(Options => {DegreeLimit => 10, Strategy => "F4"}) +derivationQuotient (RingElement, ZZ) := opts -> (w,n) -> ( + A := ring w; + I := derivationQuotientIdeal(w,n); + Igb := NCGB(I,opts#DegreeLimit, Strategy => opts#Strategy); + B := A / I; + B +) + --- load the tests -- 21 Jan 2021: there are two failing tests, which have been modified to not fail: -- one is commented out by using FAILINGTEST rather than TEST @@ -1503,13 +1663,13 @@ freeMonoid FreeAlgebra := R -> ( -- making a new type of monoid for noncommutative algebras. restart -debug Core debug needsPackage "AssociativeAlgebras" -R = QQ{x,y} +R = QQ <| x,y |> M = freeMonoid R M_0 M_1 M_1*M_0 +M_0*M_1 doc /// Key @@ -1581,16 +1741,7 @@ B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z}) basis(3,B) /// TEST /// --- 3. Double curly braces for associative algebras? -restart -needsPackage "AssociativeAlgebras" -A = QQ{{x,y,z}} -assert(instance(A,FreeAlgebra)) -B = QQ{x,y,z} -assert(instance(B,PolynomialRing)) -/// -TEST /// --- 4. isWellDefined broken for maps of nc rings. +-- 3. isWellDefined broken for maps of nc rings. restart needsPackage "AssociativeAlgebras" B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z}) @@ -1598,7 +1749,7 @@ phi = map(B,B,{y,z,x}) isWellDefined phi /// TEST /// --- 5. kernel broken for maps of nc rings (but we can make a product order which will compute it). +-- 4. kernel broken for maps of nc rings (but we can make a product order which will compute it). -- FIXED with ncKernel restart needsPackage "AssociativeAlgebras" @@ -1607,18 +1758,18 @@ phi = map(B,B,{y,z,x}) ker phi /// TEST /// --- 6. ** doesn't work right for nc rings. +-- 5. ** doesn't work right for nc rings. restart needsPackage "AssociativeAlgebras" B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z}) C = B ** B /// TEST /// --- 7. "//" doesn't work for matrices over nc rings. Need left/right ncgbs. +-- 6. "//" doesn't work for matrices over nc rings. Need left/right ncgbs. -- no test available just yet. --- 8. Documentation!!! Continue to bring over working documentation nodes from NCAlgebra --- 9. Opposite Ring and element don't work yet. --- 10. Change toM2Ring to 'abelianization' or some such +-- 7. Documentation!!! Continue to bring over working documentation nodes from NCAlgebra +-- 8. Opposite Ring and element don't work yet. +-- 9. Change toM2Ring to 'abelianization' or some such /// -- Some things not bringing over yet: From c57ef0c705aabfaf114246a0ea95a30c787672d8 Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Wed, 23 Oct 2024 20:43:22 -0400 Subject: [PATCH 132/226] Update my makefile. --- M2/BUILD/frank/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/M2/BUILD/frank/Makefile b/M2/BUILD/frank/Makefile index 0ab5caed2f5..f8ae7050964 100644 --- a/M2/BUILD/frank/Makefile +++ b/M2/BUILD/frank/Makefile @@ -29,6 +29,18 @@ cmake-appleclang: -DBUILD_NATIVE=off \ ../../../.. +cmake-clang: + echo "git branch is " $(BRANCH) + mkdir -p builds.tmp/cmake-clang + cd builds.tmp/cmake-clang; CC=/opt/homebrew/opt/llvm/bin/clang CXX=/opt/homebrew/opt/llvm/bin/clang++ cmake \ + -GNinja \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DBUILD_TESTING=on \ + -DCMAKE_PREFIX_PATH="`brew --prefix libffi`" \ + -DBUILD_DOCS=on \ + -DBUILD_NATIVE=off \ + ../../../.. + cmake-appleclang-notbb: echo "git branch is " $(BRANCH) mkdir -p builds.tmp/cmake-appleclang-notbb From a4d0f0c7361ed08b1b2666773819b95afd5e9c01 Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Wed, 23 Oct 2024 20:46:30 -0400 Subject: [PATCH 133/226] Fixed a spelling error. --- M2/Macaulay2/packages/AssociativeAlgebras.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/AssociativeAlgebras.m2 b/M2/Macaulay2/packages/AssociativeAlgebras.m2 index e2c7175c76d..2bff4c6a231 100644 --- a/M2/Macaulay2/packages/AssociativeAlgebras.m2 +++ b/M2/Macaulay2/packages/AssociativeAlgebras.m2 @@ -1549,7 +1549,7 @@ nakayamaAut FreeAlgebraQuotient := opts -> B -> ( X := matrix entries transpose splitElement sp; Y := matrix entries transpose splitElement cycleElement sp; -- should multiply by (-1)^(gldim + 1) here, but this is expensive to compute and should be known by the user. - -- the map P defined below should satify X = YP where Y is the matrix after cycling + -- the map P defined below should satisfy X = YP where Y is the matrix after cycling -- and X is the matrix representation of the original superpotential. P := (X // Y); -- if the algebra is quadratic, mult by (-1)^(word length sp + 1) From 47d4e38450ef734ea8cd4e1a7ba301ac72529416 Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Thu, 24 Oct 2024 13:15:03 -0400 Subject: [PATCH 134/226] Began work on documentation of new features. --- .../packages/AssociativeAlgebras/doc.m2 | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 b/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 index ffc623e9622..30e2c98d15f 100644 --- a/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 +++ b/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 @@ -1688,6 +1688,29 @@ doc /// delta y^2 /// +doc /// + Key + nakayamaAut + (nakayamaAut, FreeAlgebraQuotient) + (nakayamaAut, RingElement) + Headline + Computes the Nakayama automorphism using the superpotential + Usage + nu = nakayamaAut B + Inputs + B : FreeAlgebraQuotient + w : RingElement + Outputs + nu : RingMap + Description + Text + This function uses the superpotential to compute the Nakayama + automorphism of an m-Koszul AS regular algebra B. For example, + the Nakayama automorphism of the commutative polynomial ring is trivial: + Example +/// + + -* restart From a0d8cba5b8ce9f9a4fac681375c65845f3943ee5 Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Thu, 24 Oct 2024 14:26:16 -0400 Subject: [PATCH 135/226] Updated some Strategy options in AssociativeAlgebras; fixed a NCGB of zero ideal bug; updated documentation of Nakayama automorphism and superpotentials. --- M2/Macaulay2/packages/AssociativeAlgebras.m2 | 22 +++-- .../packages/AssociativeAlgebras/doc.m2 | 88 ++++++++++++++++++- 2 files changed, 100 insertions(+), 10 deletions(-) diff --git a/M2/Macaulay2/packages/AssociativeAlgebras.m2 b/M2/Macaulay2/packages/AssociativeAlgebras.m2 index 2bff4c6a231..c9d633b956d 100644 --- a/M2/Macaulay2/packages/AssociativeAlgebras.m2 +++ b/M2/Macaulay2/packages/AssociativeAlgebras.m2 @@ -353,6 +353,7 @@ setNCGBStrategy := stratStr -> ( NCGB = method(Options => {Strategy=>"F4Parallel"}) NCGB(Ideal, ZZ) := opts -> (I, maxdeg) -> ( + if I == 0 then return gens I; strat := opts#Strategy; if not I.cache.?NCGB or I.cache.NCGB#0 < maxdeg then ( tobecomputed := raw if I.cache.?NCGB then I.cache.NCGB#1 else gens I; @@ -371,6 +372,7 @@ NCGB(Ideal, ZZ) := opts -> (I, maxdeg) -> ( I.cache.NCGB#1 ) NCGB Ideal := opts -> (I) -> ( + if I == 0 then return gens I; if I.cache.?NCGB then I.cache.NCGB#1 else ( maxdegI := max((degrees source gens I) / sum); -- TODO: change once multidegrees are allowed. @@ -425,7 +427,7 @@ freeAlgebraQuotient (FreeAlgebra, Ideal, Matrix) := FreeAlgebraQuotient => (R,I, S ) -ncBasis = method(Options => {Limit => infinity}) +ncBasis = method(Options => {Strategy => "F4Parallel", Limit => infinity}) ncBasis(InfiniteNumber,InfiniteNumber,Ring) := ncBasis(List,InfiniteNumber,Ring) := ncBasis(InfiniteNumber,List,Ring) := @@ -446,7 +448,7 @@ ncBasis(List,List,Ring) := opts -> (lo,hi,R) -> ( limit := if opts.Limit === infinity then -1 else if instance(opts.Limit,ZZ) then opts.Limit else error "expected 'Limit' option to be an integer or infinity"; if #hi == 1 and hi#0 < 0 then return map(R^1, R^0, {{}}); -- disallow use of "-1" meaning infinity, at top level. - gbR := if #hi == 1 then NCGB(ideal R, hi#0) else NCGB(ideal R); + gbR := if #hi == 1 then NCGB(ideal R, hi#0, Strategy => opts.Strategy) else NCGB(ideal R, Strategy => opts.Strategy); result := map(ring gbR, rawNCBasis(raw gbR, lo, hi, limit)); map(R^1,, promote(result, R)) ) @@ -787,6 +789,8 @@ skewPolynomialRing (Ring,RingElement,List) := (R,skewElt,varList) -> ( gensA := gens A; I := ideal apply(subsets(numgens A, 2), p -> (gensA_(p#0))*(gensA_(p#1)) - promote(skewElt,R)*(gensA_(p#1))*(gensA_(p#0))); + -- this will be a GB for any coefficient ring, so we should tell the system that. + I.cache.NCGB = {infinity,gens I}; B := A/I; B ) @@ -801,7 +805,7 @@ threeDimSklyanin (Ring, List, List) := opts -> (R, params, varList) -> ( I := ideal {params#0*gensA#1*gensA#2+params#1*gensA#2*gensA#1+params#2*(gensA#0)^2, params#0*gensA#2*gensA#0+params#1*gensA#0*gensA#2+params#2*(gensA#1)^2, params#0*gensA#0*gensA#1+params#1*gensA#1*gensA#0+params#2*(gensA#2)^2}; - Igb := NCGB(I, opts.DegreeLimit, Strategy=>"F4"); + Igb := NCGB(I, opts.DegreeLimit, Strategy=>if char R == 0 then "Naive" else "F4"); B := A/I; B ) @@ -1475,7 +1479,7 @@ rightKernel Matrix := opts -> M -> ( superpotential = method(Options => {Strategy => "F4"}) superpotential FreeAlgebraQuotient := opts -> B -> ( -- compute the relations of the Koszul dual out to degree d+e-1 - -- d = number of generatos of the algebra + -- d = number of generators of the algebra -- e = relation degree A := ambient B; kk := coefficientRing A; @@ -1486,19 +1490,19 @@ superpotential FreeAlgebraQuotient := opts -> B -> ( koszB := A/koszI; -- compute a basis of the Koszul dual - allBasis := flatten apply(d+e, i -> flatten entries ncBasis(i,koszB)); + allBasis := flatten apply(d+e, i -> flatten entries ncBasis(i,koszB,Strategy => opts.Strategy)); -- find a generator of the 'top' degree of the Koszul dual topDeg := max apply(allBasis, m -> first degree m); - topForm := ncBasis(topDeg,koszB); + topForm := ncBasis(topDeg,koszB,Strategy => opts.Strategy); if numcols topForm != 1 then error "Expected (m)-Koszul AS-regular algebra."; - deg1Basis := flatten entries ncBasis(1,A); + deg1Basis := vars A; -- phi is the projection map from A to koszB phi := map(koszB,A,gens koszB); -- basis of the entire tensor algebra in the 'correct degree' - bigBasis := ncBasis(topDeg,A); + bigBasis := ncBasis(topDeg,A,Strategy => opts.Strategy); -- project the basis of the tensor algebra to the koszul dual to get a coefficient from the top form -- and take the sum of the basis with these coeffs as the superpotential @@ -1559,7 +1563,7 @@ nakayamaAut FreeAlgebraQuotient := opts -> B -> ( spWL := #(last first (toVariableList sp)); P = (-1)^(if degf == 2 then spWL + 1 else spWL)*P^(-1); -- cycling from right to left gives the inverse of the Nakayama automorphism - map(B,B,flatten entries (P*(transpose ncBasis(1,B)))) + map(B,B,flatten entries (P*(transpose vars B))) ) nakayamaAut RingElement := opts -> sp -> ( diff --git a/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 b/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 index 30e2c98d15f..6799d9d9da8 100644 --- a/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 +++ b/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 @@ -1707,9 +1707,95 @@ doc /// This function uses the superpotential to compute the Nakayama automorphism of an m-Koszul AS regular algebra B. For example, the Nakayama automorphism of the commutative polynomial ring is trivial: - Example + As a Groebner basis may need to be performed, one may pass the + strategy as an optional argument. The "Naive" strategy is used + here as the default Groebner basis strategy is not compatible with + coefficients not over a finite field, so passing this option + helps suppress certain warnings. + Example + kk = QQ + R = skewPolynomialRing(kk,1_kk,{x,y,z}) + nak = nakayamaAut(R, Strategy => "Naive") + Text + In contrast, the Nakayama automorphism of a skew polynomial + ring is given in terms of the skewing parameters: + Example + ll = frac(QQ[a,b,c]) + M = matrix {{1,a,b},{a^(-1),1,c},{b^(-1),c^(-1),1}} + S = skewPolynomialRing(ll,M,{x,y,z}) + nak2 = nakayamaAut(S, Strategy => "Naive") + Text + One may also find the Nakayama automorphism corresponding + to a twisted superpotential, although this will give a ring + map on the ambient tensor product rather than the quotient. + Example + wR = superpotential(R, Strategy => "Naive") + A = ambient R + nak3 = nakayamaAut wR + SeeAlso + superpotential /// +doc /// + Key + superpotential + (superpotential, FreeAlgebraQuotient) + Headline + Computes the (twisted) superpotential of an m-Koszul AS regular algebra + Usage + w = superpotential B + Inputs + B : FreeAlgebraQuotient + Outputs + w : RingElement + Description + Text + This function uses the Koszul dual of the algebra to compute + the superpotential of an m-Koszul AS regular algebra. The + method is laid out in Dubois-Violette's original paper on + derivation-quotient algebras. The basic algorithm is as follows: + Since the algebra is m-Koszul, its homogeneous dual is isomorphic + to the Ext algebra of the algebra, which is Frobenius since the + algebra is AS regular. Suppose the "top form" of the Frobenius + algebra is in degree m. Then given any monomial of degree m + in the ambient tensor algebra of the Koszul dual, its image + in the Koszul dual is a scalar multiple of this top form. This + provides a functional from an appropriate tensor power, and the + values of this functional are the coefficients of the superpotential. + + For an easy example, the superpotential of the commutative polynomial + ring is the "determinant form"; that is, it is the orbit sum over + the symmetric group of the product of the variables, with coefficient + given by the sign of the permutation. + Example + kk = QQ + R = skewPolynomialRing(kk,1_kk,{x,y,z,w}) + nak = superpotential(R, Strategy => "Naive") + Text + Skew polynomial rings with general skewing factors can also + be considered. + Example + ll = frac(QQ[a,b,c]) + M = matrix {{1,a,b},{a^(-1),1,c},{b^(-1),c^(-1),1}} + S = skewPolynomialRing(ll,M,{x,y,z}) + wS = superpotential(S, Strategy => "Naive") + Text + As well as any quadratic AS regular algebra, such as + Sklyanin algebras. + Example + T = threeDimSklyanin(QQ,{p,q,r}) + ideal T + wT = superpotential(T, Strategy => "Naive") + Text + Cubic AS-regular algebra of GK dimension three may also + be considered + Example + A = kk <| u,v |> + I = ideal (u^2*v + v*u^2, v^2*u + u*v^2 ) + Igb = NCGB(I, 10, Strategy => "Naive") + U = A/I + wU = superpotential(U, Strategy => "Naive") +/// -* From b9cfc3e9172db40dbc85fa8eb880dde44ab10215 Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Fri, 25 Oct 2024 21:14:13 -0400 Subject: [PATCH 136/226] Completed documentation nodes for new features. --- M2/Macaulay2/packages/AssociativeAlgebras.m2 | 14 ++-- .../packages/AssociativeAlgebras/doc.m2 | 75 +++++++++++++++++-- 2 files changed, 73 insertions(+), 16 deletions(-) diff --git a/M2/Macaulay2/packages/AssociativeAlgebras.m2 b/M2/Macaulay2/packages/AssociativeAlgebras.m2 index c9d633b956d..eac5b120c60 100644 --- a/M2/Macaulay2/packages/AssociativeAlgebras.m2 +++ b/M2/Macaulay2/packages/AssociativeAlgebras.m2 @@ -1606,15 +1606,11 @@ derivationQuotientIdeal (RingElement, ZZ) := (w,n) -> ( d := first degree w; nBasis := flatten entries ncBasis(n,A); diffs := apply(nBasis, m -> leftDiff(w,m)); - -- The code below was to create a minimal set of generators of the defining - -- ideal, but in retrospect I think its best to just leave the gens as is. - --basisA := ncBasis(d-n,A); - --coeffs := sub(last coefficients(matrix{diffs}, Monomials => basisA),baseA); - --idealGens := flatten entries (basisA*(mingens image coeffs)); - --ideal idealGens - --result := flatten entries (basisA * coeffs); - --error "err"; - ideal diffs + -- The code below was to create a minimal set of generators of the defining ideal + basisA := ncBasis(d-n,A); + coeffs := sub(last coefficients(matrix{diffs}, Monomials => basisA),baseA); + idealGens := ideal flatten entries (basisA*(mingens image coeffs)); + idealGens ) derivationQuotient = method(Options => {DegreeLimit => 10, Strategy => "F4"}) diff --git a/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 b/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 index 6799d9d9da8..a9b69f0939b 100644 --- a/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 +++ b/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 @@ -504,6 +504,7 @@ doc /// (ncBasis, Ring) (ncBasis, List, List, Ring) [ncBasis, Limit] + [ncBasis, Strategy] Headline Returns a basis of an noncommutative ring in specified degrees. Usage @@ -1616,6 +1617,7 @@ doc /// rightKernel (rightKernel,Matrix) [rightKernel,DegreeLimit] + [rightKernel,Strategy] Headline Right kernel of a matrix Usage @@ -1693,6 +1695,7 @@ doc /// nakayamaAut (nakayamaAut, FreeAlgebraQuotient) (nakayamaAut, RingElement) + [nakayamaAut, Strategy] Headline Computes the Nakayama automorphism using the superpotential Usage @@ -1708,9 +1711,9 @@ doc /// automorphism of an m-Koszul AS regular algebra B. For example, the Nakayama automorphism of the commutative polynomial ring is trivial: As a Groebner basis may need to be performed, one may pass the - strategy as an optional argument. The "Naive" strategy is used + strategy as an optional argument. Here, the "Naive" strategy is used here as the default Groebner basis strategy is not compatible with - coefficients not over a finite field, so passing this option + coefficients not over the rationals, so passing this option helps suppress certain warnings. Example kk = QQ @@ -1740,6 +1743,7 @@ doc /// Key superpotential (superpotential, FreeAlgebraQuotient) + [superpotential, Strategy] Headline Computes the (twisted) superpotential of an m-Koszul AS regular algebra Usage @@ -1768,12 +1772,16 @@ doc /// the symmetric group of the product of the variables, with coefficient given by the sign of the permutation. Example - kk = QQ + kk = ZZ/32009 R = skewPolynomialRing(kk,1_kk,{x,y,z,w}) - nak = superpotential(R, Strategy => "Naive") + nak = superpotential R Text Skew polynomial rings with general skewing factors can also - be considered. + be considered. Here we use a field of rational functions over + the rational numbers. As in the case of the rationals themselves, + the default Groebner basis algorithm is not currently designed + for such fields, so we include the "Naive" strategy to suppress + warnings. Example ll = frac(QQ[a,b,c]) M = matrix {{1,a,b},{a^(-1),1,c},{b^(-1),c^(-1),1}} @@ -1792,9 +1800,62 @@ doc /// Example A = kk <| u,v |> I = ideal (u^2*v + v*u^2, v^2*u + u*v^2 ) - Igb = NCGB(I, 10, Strategy => "Naive") + Igb = NCGB(I, 10) U = A/I - wU = superpotential(U, Strategy => "Naive") + wU = superpotential U +/// + +doc /// + Key + derivationQuotientIdeal + (derivationQuotientIdeal, RingElement, ZZ) + derivationQuotient + (derivationQuotient, RingElement, ZZ) + [derivationQuotient, Strategy] + Headline + Computes the derivation-quotient algebra of a superpotential + Usage + w = superpotential B + Inputs + w : RingElement + l : ZZ + Outputs + B : FreeAlgebraQuotient + Description + Text + Let $V$ be a vector space over a field $k$ and let $n \geq 2$ be + an integer. An element $\mathsf{w}$ of the $n^\text{th}$ + tensor power of $V$ is called a twisted superpotential if + there exists $\sigma \in \operatorname{GL}(V)$ such that + $(\text{id}^{\otimes n-1} \otimes \sigma)\theta(\mathsf{w}) = \mathsf{w}$ + where $\theta$ cycles the leftmost factor of an $n$-fold + elementary tensor to the right end. + + Given such a twisted superpotential (or really, any element of + $V^{\otimes n}$, but the algebras obtained by twisted + superpotentials are nice, as we will state soon) and an + integer $m \leq \ell - 2$, one may define the derivation-quotient + algebra, which is the algebra $T(V)/\langle \del^{m} V \rangle$, + where $\del^\ell(\mathsf{w})$ denotes the span of results of $\ell$ "formal deletions" + of the variables from the left of $\mathsf{w}$. + + A result of Dubois-Violette shows that if $A$ is an $m$-Koszul + AS regular algebra, then there exist a twisted superpotential $\mathsf{w}_A$ + such that $A \cong T(V)/\langle \del^{\ell}(\mathsf{w}_A) \rangle$, + where $\ell$ is determined by the degree of the relations of $A$, as + well as the global dimension of $A$. + + We illustrate with an example. + Example + kk = ZZ/32009 + R = skewPolynomialRing(kk,(-1)_kk,{a,b,c,d,e}) + A = ambient R + wR = superpotential R + I = derivationQuotientIdeal(wR,3) + Igb = NCGB(I,10) + R' = A/I + phi = map(R,R',gens R) + ncKernel phi /// -* From 9a48f4f0d24af8d1e699e80f39c5611b9ee0f343 Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Fri, 25 Oct 2024 21:17:19 -0400 Subject: [PATCH 137/226] Removed debugging mode. --- M2/Macaulay2/packages/AssociativeAlgebras.m2 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/AssociativeAlgebras.m2 b/M2/Macaulay2/packages/AssociativeAlgebras.m2 index eac5b120c60..e55b6d992ba 100644 --- a/M2/Macaulay2/packages/AssociativeAlgebras.m2 +++ b/M2/Macaulay2/packages/AssociativeAlgebras.m2 @@ -13,8 +13,7 @@ newPackage( Keywords => {"Noncommutative Algebra"}, PackageImports =>{"Complexes"}, PackageExports =>{"IntegralClosure"}, - AuxiliaryFiles => true, - DebuggingMode => true + AuxiliaryFiles => true ) -- TODO for tbb update: (Dec 2021) From 4cf299d5e857c03c823ad1dfba541cc9f3d8919d Mon Sep 17 00:00:00 2001 From: Mike Stillman Date: Fri, 25 Oct 2024 16:24:31 -0400 Subject: [PATCH 138/226] fix bug in Triangulations, caused by version change of Topcom. Tests added to check this. --- M2/BUILD/mike/Makefile | 45 +++++++++++++++++++++++-- M2/Macaulay2/packages/Triangulations.m2 | 16 ++++----- 2 files changed, 51 insertions(+), 10 deletions(-) diff --git a/M2/BUILD/mike/Makefile b/M2/BUILD/mike/Makefile index f1f7150601d..8168d5a9f9e 100644 --- a/M2/BUILD/mike/Makefile +++ b/M2/BUILD/mike/Makefile @@ -9,6 +9,49 @@ BREWPREFIX := `brew --prefix` ## cmake build files ## ####################### +cmake-appleclang: + echo "git branch is " $(BRANCH) + mkdir -p builds.tmp/cmake-appleclang + cd builds.tmp/cmake-appleclang; cmake \ + -GNinja \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_PREFIX_PATH="`brew --prefix libffi`" \ + -DBUILD_NATIVE=off \ + -DCMAKE_INSTALL_PREFIX=`pwd`/installed \ + -DBUILD_TESTING=on \ + -DBUILD_DOCS=on \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=true \ + ../../../.. + +cmake-clang: + echo "git branch is " $(BRANCH) + mkdir -p builds.tmp/cmake-clang + cd builds.tmp/cmake-clang; cmake \ + -GNinja \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DBUILD_TESTING=on \ + -DCMAKE_C_COMPILER="`brew --prefix llvm`/bin/clang" \ + -DCMAKE_CXX_COMPILER="`brew --prefix llvm`/bin/clang++" \ + -DBUILD_DOCS=on \ + -DBUILD_NATIVE=off \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=true \ + ../../../.. + +cmake-gcc14: + mkdir -p builds.tmp/cmake-gcc14 + cd builds.tmp/cmake-gcc14; cmake \ + -GNinja \ + -DCMAKE_C_COMPILER:FILEPATH=/opt/homebrew/opt/gcc/bin/gcc-14 \ + -DCMAKE_CXX_COMPILER:FILEPATH=/opt/homebrew/opt/gcc/bin/g++-14 \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DBUILD_TESTING=on \ + -DBUILD_DOCS=on \ + ../../../.. + +## clean up or remove all below here +## grab debug builds, autotools builds, profile builds (on linux at leasst) + + cmake-make-appleclang: echo "git branch is " $(BRANCH) mkdir -p builds.tmp/cmake-make-appleclang-$(BRANCH) @@ -59,8 +102,6 @@ cmake-appleclang: -DBUILD_DOCS=on \ ../../../.. -# -DCMAKE_PREFIX_PATH="`brew --prefix tbb@2021`;`brew --prefix libffi`;`brew --prefix`" \ - cmake-debug-appleclang: mkdir -p builds.tmp/cmake-debug-appleclang cd builds.tmp/cmake-debug-appleclang; cmake \ diff --git a/M2/Macaulay2/packages/Triangulations.m2 b/M2/Macaulay2/packages/Triangulations.m2 index edf54052a7c..52abd07a043 100644 --- a/M2/Macaulay2/packages/Triangulations.m2 +++ b/M2/Macaulay2/packages/Triangulations.m2 @@ -1,7 +1,7 @@ newPackage( "Triangulations", - Version => "0.1", - Date => "13 Nov 2022", + Version => "0.2", + Date => "25 Oct 2024", Authors => {{ Name => "Mike Stillman", Email => "mike@math.cornell.edu", @@ -352,7 +352,7 @@ link(List, List) := (tau, triangulation) -> ( flips = method(Options => options topcomFlips) flips Triangulation := List => opts -> T -> ( - first topcomFlips(matrix T, max T, Homogenize => false, RegularOnly => opts.RegularOnly) -- TODO: "first" here is a hack, until topcom version is set. + topcomFlips(matrix T, max T, Homogenize => false, RegularOnly => opts.RegularOnly) ) bistellarFlip = method() @@ -875,8 +875,9 @@ TEST /// T = regularFineTriangulation A naiveIsTriangulation T -- TODO: doc this, and allow A to be homogenized? Same with topcomIsTriangulation -- XX - flips T -- not really functional. Returns internal stuff. I don't understand the format... + assert(set flips T === set{{{0, 3}, {4}}, {{1, 2}, {4}}}) orientedCircuits A + assert isSubset(flips T, orientedCircuits A) orientedCocircuits A chirotope A assert(naiveChirotopeString A === chirotopeString A) @@ -1117,7 +1118,6 @@ TEST /// needsPackage "Triangulations" *- debug needsPackage "Topcom" - topcompath = "/opt/homebrew/bin/" -- this tests construction of the chirotope. A = transpose matrix"0,0;1,1;3,1;5,0;1,5" @@ -1137,17 +1137,17 @@ TEST /// -- assert(tri/sort//sort == ({{0, 1, 2}, {0, 2, 3}, {1, 2, 4}, {0, 1, 4}, {2, 3, 4}})/sort//sort) -- now find the possible flips. Can we get topcom to do the flips? - flips T -- output needs to change. + assert(set flips T === set {{{0, 2, 4}, {1}}, {{1, 3}, {0, 2}}}) + assert(isSubset((flips T)/sort, (orientedCircuits A)/sort)) -- I don't see how to get topcom to use these though. /// TEST /// -* - -- XXX current test being worked on restart needsPackage "Triangulations" *- - -- test if bistellar flips code. + -- test of bistellar flips code. -- example 1. debug needsPackage "Topcom" From 8bd56c19b0cd15cbeb398b3a8430fda60b40c494 Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Sat, 26 Oct 2024 07:36:42 -0700 Subject: [PATCH 139/226] fixed the urls in Pencils.. --- M2/Macaulay2/packages/PencilsOfQuadrics.m2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 index 44cce1ab38e..b60f7e5aff2 100644 --- a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 +++ b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 @@ -17,13 +17,13 @@ peek loadedFiles Date => "October 10, 2024", Authors => {{Name => "Frank-Olaf Schreyer", Email => "schreyer@math.uni-sb.de", - HomePage => ""}, + HomePage => "https://www.math.uni-sb.de/ag/schreyer/index.php/"}, {Name => "David Eisenbud", Email => "de@msri.org", - HomePage => "www.msri.org/~de"}, + HomePage => "https://eisenbud.github.io/"}, {Name => "Yeongrak Kim", Email => "yeongrak.kim@pusan.ac.kr", - HomePage => "sites.google.com/view/yeongrak"} + HomePage => "https://sites.google.com/view/yeongrak"} }, PackageExports => {"CompleteIntersectionResolutions"}, Headline => "Clifford Algebra of a pencil of quadratic forms", From 3e672a632599aa32f9e9da99616207162aab119b Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Sat, 26 Oct 2024 12:03:03 -0700 Subject: [PATCH 140/226] inserted setRandomSeed commands whereever a TEST or doc node called a random function --- M2/Macaulay2/packages/PencilsOfQuadrics.m2 | 501 ++++++++++----------- 1 file changed, 249 insertions(+), 252 deletions(-) diff --git a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 index b60f7e5aff2..5a1715a828a 100644 --- a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 +++ b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 @@ -1,14 +1,11 @@ /// restart -loadPackage "CompleteIntersectionResolutions" loadPackage "PencilsOfQuadrics" uninstallPackage("PencilsOfQuadrics") +restart installPackage("PencilsOfQuadrics") check "PencilsOfQuadrics" viewHelp "PencilsOfQuadrics" -needsPackage"CompleteIntersectionResolutions" -loadPackage("PencilsOfQuadrics", Reload=>true) -peek loadedFiles /// newPackage( @@ -427,24 +424,6 @@ matrixFactorizationK(Matrix,Matrix) := (X,Y) -> ( (M1,M2) ) -TEST/// --- test of matrixFactorizationK -kk=ZZ/101 -d=2 -n=2*d -R=kk[a_0..a_(binomial(n+2,2))] -S=kk[x_0..x_(n-1),a_0..a_(binomial(n+2,2))] -M=genericSymmetricMatrix(S,a_0,n) -X=(vars S)_{0..n-1} -Y=X*M -(M1,M2)=matrixFactorizationK(X,Y); -M12=M1*M2; -assert(M12-M12_(0,0)*id_(target M12)==0) -assert(isHomogeneous M1) -assert(isHomogeneous M2) -assert(source M1==target M2) -assert( source M2==target M1**S^{-3}) -/// matFact = (X,Y) -> ( @@ -628,34 +607,6 @@ centers(List,List) := (eOdd,eEv) -> ( -TEST/// - --- Testing the pfaffian formula - -kk=ZZ/101 -d=1 -n=2*d -R=kk[a_0..a_(binomial(n+2,2)-1)] -S=kk[x_0..x_(n-1),a_0..a_(binomial(n+2,2)-1)] -M=genericSymmetricMatrix(S,a_0,n) -X=(vars S)_{0..n-1} -Y=X*M -(M1,M2)=matrixFactorizationK(X,Y); -(eOdd,eEv)=cliffordOperators(M1,M2,R); -symMatrix(eOdd,eEv) -(c0,c1)=centers(eOdd,eEv); -assert isHomogeneous c0 -assert isHomogeneous c1 -betti c0, betti c1 -all(n,i->eOdd_i*c1+c0*eOdd_i==0) -all(n,i->eEv_i*c0+c1*eEv_i==0) -assert(target eEv_0 == target c1) -assert(target eOdd_0 == target c0) -determ=det symMatrix(eOdd,eEv) --- Note the factor (-1)^d occurs in the test below -assert(c0^2-(-1)^d*determ*id_(target c0)==0) -assert(c1^2-(-1)^d*determ*id_(source c1)==0) -/// factorToList = method() factorToList(Product) := pf ->( @@ -749,12 +700,11 @@ randomLineBundle(ZZ, RingElement) := (d,f) -> ( ); Ld ) - - -TEST/// ---test of preRandomLineBundle and randomLineBundle -restart -load "PencilsOfQuadrics.m2" +/// +--restart +--load "PencilsOfQuadrics.m2" +/// +///--test of preRandomLineBundle and randomLineBundle-- but there were no "asserts" kk = ZZ/nextPrime(10^3) R = kk[ s,t] g = 3 @@ -771,9 +721,6 @@ betti preLd.yAction)) tally apply(100, i->( Ld=randomLineBundle(d,f); betti Ld.yAction)) - - - /// @@ -807,25 +754,6 @@ restart loadPackage("PencilsOfQuadrics", Reload =>true) check "PencilsOfQuadrics" /// -TEST/// -kk=ZZ/101 -g=1 -(S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g) -(uOdd,uEv)=cliffordOperators(Mu1,Mu2,R) -(c0,c1)=centers(uOdd,uEv) -symMatrix(uOdd,uEv) -f=det symMatrix(uOdd,uEv) -assert(c0^2+(-1)^g*f*id_(target c0)==0) -L=randomLineBundle(0,f) -m=L.yAction -assert((m)^2_(0,0)+(-1)^g*f==0) ---b = random(2*g+2, R) -assert isHomogeneous m -degOnE L -orderInPic L - ---lcm apply(10,c-> (L=randomLineBundle(0,f); orderInPic L)) -/// degOnE = method() degOnE(Matrix) := (L) -> ( @@ -958,23 +886,6 @@ f=random(4,R) factor f /// -TEST/// ---test of tensorProduct of randomLineBundle and degreeOnE and orderInPic -kk = ZZ/101 -R = kk[ s,t] -g = 1 - -f = random(2*g+2, R) -assert(dim ideal(jacobian ideal f)== 0) -L1=randomLineBundle(1,f) -assert(degOnE L1 == 1) -L2=randomLineBundle(2,f) -assert(degOnE L2 == 2) -L0 = randomLineBundle(0,f) -assert(degOnE L0 == 0) -assert(degOnE tensorProduct(L1,L1) == 2) -orderInPic randomLineBundle(0,f) -/// @@ -1113,24 +1024,6 @@ cliffordModule(Matrix,Matrix,Ring) := (M1,M2,R)->( -TEST/// -kk=ZZ/101 -g=1 -(S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g) -(uOdd,uEv)=cliffordOperators(Mu1,Mu2,R) -(c0,c1)=centers(uOdd,uEv) -betti c0 -betti c1 -symMatrix(uOdd,uEv) -f=det symMatrix(uOdd,uEv) -cMu = cliffordModule(uOdd, uEv) -cM = cliffordModule(M1, M2, R) -cM.oddOperators -cMu.symmetricM -class cM - -assert ((cMu.evenCenter, cMu.oddCenter)==centers(cMu.oddOperators, cMu.evenOperators)) -/// randomExtension=method() randomExtension(Matrix,Matrix) := (m1,m2) -> ( @@ -1484,44 +1377,6 @@ cliffordModuleToMatrixFactorization(CliffordModule,Ring) := (M,S) ->( N1' := map(target (S^{1}**N1),,N1); N2' := map(target (S^{-1}**N2),,N2); (N1', N2')) -TEST/// -kk = ZZ/101;g= 1 -(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); -M = cliffordModule(Mu1, Mu2, R) -(Mu1', Mu2') = cliffordModuleToMatrixFactorization (M,S); -assert(Mu1'-Mu1 == 0 and Mu2'-Mu2 ==0) -assert(Mu1'==Mu1) -assert(Mu2'==Mu2) -betti Mu1', betti Mu1 -betti Mu2', betti Mu2 -M = cliffordModule(M1, M2, R); -(M1', M2') = cliffordModuleToMatrixFactorization (M,S); -assert(M1'-M1 == 0 and M2'-M2 ==0) -betti M1', betti M1 -assert(M1'==M1) -betti M2', betti M2 -assert(M2'==M2) ---g=2 - -kk = ZZ/101;g=2 -(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); -M = cliffordModule(Mu1, Mu2, R) -(Mu1', Mu2') = cliffordModuleToMatrixFactorization (M,S); -assert(Mu1'-Mu1 == 0 and Mu2'-Mu2 ==0) -betti Mu1', betti Mu1 -betti Mu2', betti Mu2 -assert(Mu1'==Mu1) -assert(Mu2'==Mu2) - - -M = cliffordModule(M1, M2, R); -(M1', M2') = cliffordModuleToMatrixFactorization (M,S); -assert(M1'-M1 == 0 and M2'-M2 ==0) -assert(M1'==M1) -assert(M2'==M2) -betti M1', betti M1 -betti M2', betti M2 -/// -- Translating isotropic subspaces by degree 0 line bundles translateIsotropicSubspace = method() @@ -1587,19 +1442,6 @@ randomIsotropicSubspace(CliffordModule, PolynomialRing) := (M,S) -> ( ) -TEST/// --- needsPackage "PencilsOfQuadrics" -kk=ZZ/101;g=2 -(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); - -M=cliffordModule (Mu1, Mu2, R); -f=M.hyperellipticBranchEquation; -L=randomLineBundle(0,f) -uL=translateIsotropicSubspace(M,L,S) - -rU=randomIsotropicSubspace(M,S) -assert (betti rU == betti u) -/// /// @@ -1638,80 +1480,6 @@ cliffordModuleToCIResolution(CliffordModule,Ring, Ring) :=(M,S,CI) ->( restart loadPackage "PencilsOfQuadrics" /// -TEST/// -kk = ZZ/101;g=1 -(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); -diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq) -P = kk[drop(gens S, -2)] -qs = sub(diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq), P) -CI = P/ideal qs - -F = res( coker (sub(u, CI)), LengthLimit => 3) -betti (FF = res( coker transpose F.dd_3, LengthLimit => 5)) -M = cliffordModule(Mu1, Mu2, R) -betti (F1=cliffordModuleToCIResolution(M,S,CI)) -betti FF -betti (FFF = res coker FF.dd_5) -q1 = diff(S_(2*g+2),qq) -q2 = diff(S_(2*g+3),qq) -N = (S^1/(ideal(q1,q2))**coker sub(F.dd_2,S)) -betti res (N, LengthLimit =>10) -betti F1.dd_(g+3-(g%2)) -assert(ideal F1.dd_(g+3-(g%2))_{0} ==ideal sub(u,CI)) -M = cliffordModule(M1,M2,R) -betti (F2=cliffordModuleToCIResolution(M,S,CI)) -assert(ideal F2.dd_(2*g+3)_{0}^{0..2*g+1} == ideal gens CI) ------ now genus 2 -g=2 -(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); -diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq) -P = kk[drop(gens S, -2)] -qs = sub(diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq), P) -CI = P/ideal qs - -F = res( coker (sub(u, CI)), LengthLimit => 3) -betti (FF = res( coker transpose F.dd_3, LengthLimit => 5)) -M = cliffordModule(Mu1, Mu2, R) -betti (F1=cliffordModuleToCIResolution(M,S,CI)) -betti FF -betti F1.dd_(g+3-(g%2)) -assert(ideal F1.dd_(g+3-(g%2))_{0} ==ideal sub(u,CI)) -M = cliffordModule(M1,M2,R) -betti (F2=cliffordModuleToCIResolution(M,S,CI)) -assert(ideal F2.dd_(2*g+3)_{0}^{0..2*g+1} == ideal gens CI) --* -g=3 -(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); -diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq) -P = kk[drop(gens S, -2)] -qs = sub(diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq), P) -CI = P/ideal qs - -F = res( coker (sub(u, CI)), LengthLimit => 3) -betti (FF = res( coker transpose F.dd_3, LengthLimit => 5)) -M = cliffordModule(Mu1, Mu2, R) -betti (F1=cliffordModuleToCIResolution(M,S,CI)) -betti FF -betti F1.dd_(g+3-(g%2)) -assert(ideal F1.dd_(g+3-(g%2))_{0} ==ideal sub(u,CI)) -M = cliffordModule(M1,M2,R) -betti (F2=cliffordModuleToCIResolution(M,S,CI)) -assert(ideal F2.dd_(2*g+3)_{0}^{0..2*g+1} == ideal gens CI) -*- - -/// - -TEST/// -restart -loadPackage "PencilsOfQuadrics" -debug PencilsOfQuadrics -kk = ZZ/101 -R = kk[s,t,x,y,z] -mm = ideal(x,y,z) -L = ext1Prep(R,mm) -assert ((L_0)_1 == coker matrix{{x^2,y,z}}) -/// - ciModuleToCliffordModule = method() @@ -1782,7 +1550,7 @@ randomNicePencil(kk,2) isMinimal = method() isMinimal(Ideal, ChainComplex) := (mm, F) -> ( - --tests whether the differential is in mm + --test whether the differential is in mm n := length F; R := ring F; k := R^1/mm; @@ -1882,14 +1650,6 @@ horizontalConcatenate = L ->( -TEST/// -restart -loadPackage "PencilsOfQuadrics" -debug PencilsOfQuadrics -N = ZZ^2 -L = {id_N,id_N} -horizontalConcatenate L -/// beginDocumentation() @@ -2028,6 +1788,7 @@ doc /// Using the multigrading, a new matrix factorization in the form needed for cliffordModule(e1,e0,R), where R=k[s,t]. Example + setRandomSeed 0 n = 4 c = 2 kk = ZZ/101 @@ -2159,6 +1920,7 @@ doc /// \{(s,t) | s*q1+t*q2 is singular\} \subset PP^1. Example + setRandomSeed 0 kk=ZZ/101 g=1 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); @@ -2198,6 +1960,7 @@ doc /// Generates a random pencil of quadrics in the same way as randomNicePencil(kk,g). Returns a hash table of the type RandomNicePencil. Example + setRandomSeed 0 kk=ZZ/101; g=1; L=randNicePencil(kk,g) @@ -2330,6 +2093,7 @@ doc /// Text The list of the even operators uEv_i: M_0\to M_1 Example + setRandomSeed 0 kk = ZZ/101 g = 1 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); @@ -2356,6 +2120,7 @@ doc /// Text The list of the odd operators uOdd_i: M_1\to M_0 Example + setRandomSeed 0 kk = ZZ/101 g = 1 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); @@ -2381,6 +2146,7 @@ doc /// Text Gives the action of Haag's center element y of the even Clifford algebra on the even part of M Example + setRandomSeed 0 kk = ZZ/101 g = 1 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); @@ -2408,6 +2174,7 @@ doc /// Text the underlying pencil of quadratic forms Example + setRandomSeed 0 kk = ZZ/101 g = 1 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); @@ -2439,6 +2206,7 @@ doc /// Text Gives the action of Haag's center element y of the even Clifford algebra on the odd part of M Example + setRandomSeed 0 kk = ZZ/101 g = 1 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); @@ -2473,6 +2241,7 @@ doc /// Example kk = ZZ/101 + setRandomSeed 0 g = 1 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); M = cliffordModule(M1,M2, R) @@ -2507,6 +2276,7 @@ doc /// the pencil of quadratic forms defining the Clifford algebra. The functions symmetricMatrix and symMatrix are the same. Example + setRandomSeed 0 kk = ZZ/101 g = 1 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); @@ -2538,6 +2308,7 @@ doc /// points over which the associated quadratic form is singular. It is same as the determinant of the symmetric matrix M.symmetricM. Example + setRandomSeed 0 kk=ZZ/101; g=1; rNP=randNicePencil(kk,g); @@ -2567,9 +2338,8 @@ doc /// Description Text The base ring kk[s,t] which is the coordnate ring of PP^1. - Example - kk=ZZ/101; g=1; + kk=ZZ/101; rNP=randNicePencil(kk,g); R=rNP.baseRing @@ -2597,6 +2367,7 @@ doc /// Text The ambient polynomial ring where the quadratic form qq = s*q1 + t*q2 lives. Example + setRandomSeed 0 kk=ZZ/101; g=1; rNP=randNicePencil(kk,g); @@ -2627,6 +2398,7 @@ doc /// the polynomial that represents a pencil of quadrics qq=s*q1+t*q2 with a fixed isotropic subspace and a fixed corank one quadric in normal form q1. Example + setRandomSeed 0 kk=ZZ/101; g=1; rNP=randNicePencil(kk,g); @@ -2661,6 +2433,7 @@ doc /// a row matrix whose entries are generators of the ideal of an isotropic subspace for qq. Example kk=ZZ/101; + setRandomSeed 0 g=1; rNP=randNicePencil(kk,g); @@ -2691,6 +2464,7 @@ doc /// of the base ring R=S/(ideal matrix x_0..y_{(g-1)},z_1,z_2) as a module over S/(ideal qq). These are used to construct the Clifford algebra of qq. Example + setRandomSeed 0 kk=ZZ/101; g=1; rNP=randNicePencil(kk,g); @@ -2727,6 +2501,7 @@ doc /// of the base ring R=S/(ideal matrix x_0..y_{(g-1)},z_1,z_2) as a module over S/(ideal qq). These are used to construct the Clifford algebra of qq. Example + setRandomSeed 0 kk=ZZ/101; g=1; rNP=randNicePencil(kk,g); @@ -2765,6 +2540,7 @@ doc /// and the hyperelliptic curve branched over the degeneracy locus of the pencil. Example kk=ZZ/101; + setRandomSeed 0 g=1; rNP=randNicePencil(kk,g); S=rNP.qqRing; @@ -2802,6 +2578,7 @@ doc /// and the hyperelliptic curve branched over the degeneracy locus of the pencil. Example kk=ZZ/101; + setRandomSeed 0 g=1; rNP=randNicePencil(kk,g); S=rNP.qqRing; @@ -2888,6 +2665,7 @@ doc /// is singular. Example kk = ZZ/101 + setRandomSeed 0 g = 1 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); M = cliffordModule(M1,M2, R) @@ -2959,6 +2737,7 @@ doc /// where the index I runs over all even length ordered subsets of [2d]. Example + setRandomSeed 0 kk=ZZ/101; d=1; n=2*d R=kk[a_0..a_(binomial(n+2,2)-1)] @@ -3025,6 +2804,7 @@ doc /// is found. Note that this works well over a finite field, but is unlikely to work over QQ. Example + setRandomSeed 0 kk=ZZ/101 R = kk[s,t] f =(s+2*t)*(s+t)*(s-t)*(s-2*t) @@ -3062,6 +2842,7 @@ doc /// Text A matrix representing the action of y for the hyperelliptic curve E with equation y^2 - (-1)^g * f. Example + setRandomSeed 0 kk = ZZ/101; R = kk[s,t]; f = (s+2*t)*(s+t)*(s-t)*(s-2*t); @@ -3114,6 +2895,7 @@ doc /// Example kk=ZZ/101 + setRandomSeed 0 g=1 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g) ; (uOdd,uEv)=cliffordOperators(Mu1,Mu2,R); @@ -3158,6 +2940,7 @@ doc /// Computes the degree of a vector bundle L on the hyperelliptic curve E. Example kk=ZZ/101; + setRandomSeed 0 g=1; rNP=randNicePencil(kk,g); @@ -3200,6 +2983,7 @@ doc /// Text Computes the order of a degree 0 line bundle L on the hyperelliptic curve E by the most naive method. Example + setRandomSeed 0 kk=ZZ/101; g=1; rNP=randNicePencil(kk,g); @@ -3256,6 +3040,7 @@ doc /// Example kk=ZZ/101; + setRandomSeed 0 g=1; rNP=randNicePencil(kk,g); cM=cliffordModule(rNP.matFact1,rNP.matFact2,rNP.baseRing); @@ -3313,6 +3098,7 @@ doc /// Example kk=ZZ/1009; + setRandomSeed 0 g=2; rNP=randNicePencil(kk,g); cM=cliffordModule(rNP.matFact1,rNP.matFact2,rNP.baseRing); @@ -3357,6 +3143,7 @@ doc /// Chooses a random extension of V2 by V1, where V1, V2 are vector bundles on E represented by the type VectorBundleOnE. Example + setRandomSeed 0 kk=ZZ/101; g=1; rNP=randNicePencil(kk,g); @@ -3418,6 +3205,7 @@ doc /// From this representation we read off a matrix factorization (M1, M2) of qq. Example kk=ZZ/101; + setRandomSeed 0 g=1; rNP=randNicePencil(kk,g); qq=rNP.quadraticForm; @@ -3481,6 +3269,7 @@ doc /// its minimal free resolution over CI. This function uses cliffordModuleToMatrixFactorization. Example kk=ZZ/101; + setRandomSeed 0 g=1; rNP=randNicePencil(kk,g); qq=rNP.quadraticForm; @@ -3546,6 +3335,7 @@ doc /// Example kk=ZZ/101; + setRandomSeed 0 g=2; rNP=randNicePencil(kk,g); S=rNP.qqRing; @@ -3600,6 +3390,7 @@ doc /// g=3 kk= ZZ/101; + setRandomSeed 0 elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); -- 0.644455 seconds elapsed M=cliffordModule(Mu1,Mu2,R) @@ -3667,7 +3458,8 @@ doc /// computes the maximal isotropic subspace uL corresponding to the translation of u by L. Example - kk=ZZ/101; + kk=ZZ/101; + setRandomSeed 0 g=2; (S,qq,R,u, M1,M2, Mu1,Mu2) = randomNicePencil(kk,g); @@ -3709,7 +3501,8 @@ doc /// computes the maximal isotropic subspace ru corresponding to the translation of u by L. Example - kk=ZZ/101; + kk=ZZ/101; + setRandomSeed 0 g=2; (S,qq,R,u, M1,M2, Mu1,Mu2) = randomNicePencil(kk,g); @@ -3724,10 +3517,213 @@ doc /// CliffordModule /// - +--TEST SECTION-- --------------- ---tests------- --------------- +TEST/// +setRandomSeed 0 +kk = ZZ/101;g=1 +(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); +diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq) +P = kk[drop(gens S, -2)] +qs = sub(diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq), P) +CI = P/ideal qs + +F = res( coker (sub(u, CI)), LengthLimit => 3) +betti (FF = res( coker transpose F.dd_3, LengthLimit => 5)) +M = cliffordModule(Mu1, Mu2, R) +betti (F1=cliffordModuleToCIResolution(M,S,CI)) +betti (FFF = res coker FF.dd_5) +q1 = diff(S_(2*g+2),qq) +q2 = diff(S_(2*g+3),qq) +N = (S^1/(ideal(q1,q2))**coker sub(F.dd_2,S)) +assert(ideal F1.dd_(g+3-(g%2))_{0} ==ideal sub(u,CI)) +M = cliffordModule(M1,M2,R) +betti (F2=cliffordModuleToCIResolution(M,S,CI)) +assert(ideal F2.dd_(2*g+3)_{0}^{0..2*g+1} == ideal gens CI) +----- now genus 2 +g=2 +(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); +diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq) +P = kk[drop(gens S, -2)] +qs = sub(diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq), P) +CI = P/ideal qs + +F = res( coker (sub(u, CI)), LengthLimit => 3) +betti (FF = res( coker transpose F.dd_3, LengthLimit => 5)) +M = cliffordModule(Mu1, Mu2, R) +betti (F1=cliffordModuleToCIResolution(M,S,CI)) +assert(ideal F1.dd_(g+3-(g%2))_{0} ==ideal sub(u,CI)) +M = cliffordModule(M1,M2,R) +betti (F2=cliffordModuleToCIResolution(M,S,CI)) +assert(ideal F2.dd_(2*g+3)_{0}^{0..2*g+1} == ideal gens CI) + +--This was omitted from a test because it's slow +kk = ZZ/101;g=1 +g=3 +(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); +diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq) +P = kk[drop(gens S, -2)] +qs = sub(diff(matrix{{S_(2*g+2), S_(2*g+3)}}, qq), P) +CI = P/ideal qs + +F = res( coker (sub(u, CI)), LengthLimit => 3) +betti (FF = res( coker transpose F.dd_3, LengthLimit => 5)) +M = cliffordModule(Mu1, Mu2, R) +betti (F1=cliffordModuleToCIResolution(M,S,CI)) +assert(ideal F1.dd_(g+3-(g%2))_{0} ==ideal sub(u,CI)) +M = cliffordModule(M1,M2,R) +betti (F2=cliffordModuleToCIResolution(M,S,CI)) +assert(ideal F2.dd_(2*g+3)_{0}^{0..2*g+1} == ideal gens CI) +/// + + +TEST///-* test of randomIsotropicSubspace*- +-- needsPackage "PencilsOfQuadrics" +setRandomSeed 0 +kk=ZZ/101;g=2 +(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); + +M=cliffordModule (Mu1, Mu2, R); +f=M.hyperellipticBranchEquation; +L=randomLineBundle(0,f) +uL=translateIsotropicSubspace(M,L,S) + +rU=randomIsotropicSubspace(M,S) +assert (betti rU == betti u) +/// + +TEST///-*test of cliffordModuleToMatrixFactorization*- +setRandomSeed 0 +kk = ZZ/101;g= 1 +(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); +M = cliffordModule(Mu1, Mu2, R) +(Mu1', Mu2') = cliffordModuleToMatrixFactorization (M,S); +assert(Mu1'-Mu1 == 0 and Mu2'-Mu2 ==0) +assert(Mu1'==Mu1) +assert(Mu2'==Mu2) +M = cliffordModule(M1, M2, R); +(M1', M2') = cliffordModuleToMatrixFactorization (M,S); +assert(M1'-M1 == 0 and M2'-M2 ==0) +assert(M1'==M1) +assert(M2'==M2) + +--g=2 +kk = ZZ/101;g=2 +(S,qq,R,u, M1,M2, Mu1, Mu2) = randomNicePencil(kk,g); +M = cliffordModule(Mu1, Mu2, R) +(Mu1', Mu2') = cliffordModuleToMatrixFactorization (M,S); +assert(Mu1'-Mu1 == 0 and Mu2'-Mu2 ==0) +assert(Mu1'==Mu1) +assert(Mu2'==Mu2) +M = cliffordModule(M1, M2, R); +(M1', M2') = cliffordModuleToMatrixFactorization (M,S); +assert(M1'-M1 == 0 and M2'-M2 ==0) +assert(M1'==M1) +assert(M2'==M2) +/// + +TEST///-*test of centers*- +setRandomSeed 0 +kk=ZZ/101 +g=1 +(S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g) +(uOdd,uEv)=cliffordOperators(Mu1,Mu2,R) +(c0,c1)=centers(uOdd,uEv) +betti c0 +betti c1 +symMatrix(uOdd,uEv) +f=det symMatrix(uOdd,uEv) +cMu = cliffordModule(uOdd, uEv) +cM = cliffordModule(M1, M2, R) +assert ((cMu.evenCenter, cMu.oddCenter)==centers(cMu.oddOperators, cMu.evenOperators)) +/// + +TEST///-*test of tensorProduct of randomLineBundle and degreeOnE and orderInPic*- +setRandomSeed 0 +kk = ZZ/101 +R = kk[ s,t] +g = 1 +f = random(2*g+2, R) +assert(dim ideal(jacobian ideal f)== 0) +L1=randomLineBundle(1,f) +assert(degOnE L1 == 1) +L2=randomLineBundle(2,f) +assert(degOnE L2 == 2) +L0 = randomLineBundle(0,f) +assert(degOnE L0 == 0) +assert(degOnE tensorProduct(L1,L1) == 2) +assert(orderInPic randomLineBundle(0,f) == 2) +/// + + +TEST///-*Test of the pfaffian formula *- +kk=ZZ/101 +d=1 +n=2*d +R=kk[a_0..a_(binomial(n+2,2)-1)] +S=kk[x_0..x_(n-1),a_0..a_(binomial(n+2,2)-1)] +M=genericSymmetricMatrix(S,a_0,n) +X=(vars S)_{0..n-1} +Y=X*M +(M1,M2)=matrixFactorizationK(X,Y); +(eOdd,eEv)=cliffordOperators(M1,M2,R); +symMatrix(eOdd,eEv) +(c0,c1)=centers(eOdd,eEv); +assert isHomogeneous c0 +assert isHomogeneous c1 +betti c0, betti c1 +assert(all(n,i->eOdd_i*c1+c0*eOdd_i==0)) +assert(all(n,i->eEv_i*c0+c1*eEv_i==0)) +assert(target eEv_0 == target c1) +assert(target eOdd_0 == target c0) +determ=det symMatrix(eOdd,eEv) +-- Note the factor (-1)^d occurs in the test below +assert(c0^2-(-1)^d*determ*id_(target c0)==0) +assert(c1^2-(-1)^d*determ*id_(source c1)==0) +/// + + +TEST///-*test of randomNicePencil*- +setRandomSeed 0 +kk=ZZ/101 +g=1 +(S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g) +(uOdd,uEv)=cliffordOperators(Mu1,Mu2,R) +(c0,c1)=centers(uOdd,uEv) +symMatrix(uOdd,uEv) +f=det symMatrix(uOdd,uEv) +assert(c0^2+(-1)^g*f*id_(target c0)==0) +L=randomLineBundle(0,f) +m=L.yAction +assert((m)^2_(0,0)+(-1)^g*f==0) +--b = random(2*g+2, R) +assert isHomogeneous m +degOnE L +orderInPic L +/// + + +TEST/// +-- test of matrixFactorizationK +kk=ZZ/101 +d=2 +n=2*d +R=kk[a_0..a_(binomial(n+2,2))] +S=kk[x_0..x_(n-1),a_0..a_(binomial(n+2,2))] +M=genericSymmetricMatrix(S,a_0,n) +X=(vars S)_{0..n-1} +Y=X*M +(M1,M2)=matrixFactorizationK(X,Y); +M12=M1*M2; +assert(M12-M12_(0,0)*id_(target M12)==0) +assert(isHomogeneous M1) +assert(isHomogeneous M2) +assert(source M1==target M2) +assert( source M2==target M1**S^{-3}) +/// + TEST/// kk=ZZ/101 d=2 @@ -3753,6 +3749,7 @@ end-- -- coker mm is isomorphic to coker transpose nn restart uninstallPackage "PencilsOfQuadrics" +restart installPackage "PencilsOfQuadrics" check "PencilsOfQuadrics" kk=ZZ/101 From 10646582716e07114f7b51bde91738445b85090c Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 20 Oct 2024 08:59:35 -0400 Subject: [PATCH 141/226] Detect TOPCOM package on Arch Linux It prepends "topcom-" to just some of the binaries. This means we need to check two binaries (one with the prefix and one without) to distinguish the Arch package from the Debian one (which prepends "topcom-" to everything). --- M2/Macaulay2/packages/Topcom.m2 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/Topcom.m2 b/M2/Macaulay2/packages/Topcom.m2 index 0131b54431f..ba75b3cfe39 100644 --- a/M2/Macaulay2/packages/Topcom.m2 +++ b/M2/Macaulay2/packages/Topcom.m2 @@ -77,10 +77,12 @@ topcomPoints Matrix := opts -> (A) -> ( callTopcom = method() callTopcom(String, List) := (command, inputs) -> ( if topcomProgram === null then - topcomProgram = findProgram("topcom","cube 3", Prefix => { + topcomProgram = findProgram("topcom", {"cube 3", "B_A 3"}, Prefix => { (".*", "topcom-"), -- debian ("^(cross|cube|cyclic|hypersimplex|lattice)$", "TOPCOM-"), --fedora - ("^cube$", "topcom_")}); --gentoo + ("^cube$", "topcom_"), --gentoo + ("^(binomial|cross|cube|cyclic|lattice)$", "topcom-") --arch + }); filename := temporaryFileName(); infile := filename|".in"; -- now create the output file From 00079fc725acbbc58cde1d65ed513b3597b406a9 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Sat, 26 Oct 2024 22:21:17 +0200 Subject: [PATCH 142/226] Revert "fix error location in tail call" --- M2/Macaulay2/d/evaluate.d | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/M2/Macaulay2/d/evaluate.d b/M2/Macaulay2/d/evaluate.d index 209b866ea7c..8c4629f4cbe 100644 --- a/M2/Macaulay2/d/evaluate.d +++ b/M2/Macaulay2/d/evaluate.d @@ -29,7 +29,6 @@ export nextS := setupvar("next", nullE); export applyIteratorS := setupvar("applyIterator", nullE); export joinIteratorsS := setupvar("joinIterators", nullE); -handleError(c:Code,e:Expr):Expr; eval(c:Code):Expr; applyEE(f:Expr,e:Expr):Expr; export evalAllButTail(c:Code):Code := while true do c = ( @@ -631,11 +630,11 @@ export applyFCC(fc:FunctionClosure,ec:Code):Expr := ( f.frameID = desc.frameID; f.values.0 = e; ); - ret := nullE; tailCode := dummyCode; + ret := nullE; while true do ( localFrame = f; recursionDepth = recursionDepth + 1; - tailCode = evalAllButTail(model.body); + tailCode := evalAllButTail(model.body); recursionDepth = recursionDepth - 1; -- formerly, just ret := eval(model.body); now do tail recursion instead when tailCode @@ -748,7 +747,7 @@ export applyFCC(fc:FunctionClosure,ec:Code):Expr := ( f.frameID = -2; -- just to be tidy, not really needed recycleBin.framesize = f; ); - when ret is Error do returnFromFunction(handleError(tailCode,ret)) else ret -- this check takes time, too! + when ret is err:Error do returnFromFunction(ret) else ret -- this check takes time, too! ) else ( f := Frame(previousFrame,desc.frameID,framesize,false, @@ -1315,7 +1314,7 @@ steppingFurther(c:Code):bool := steppingFlag && ( microStepCount >= 0) else false); -export handleError(c:Code,e:Expr):Expr := ( +handleError(c:Code,e:Expr):Expr := ( when e is err:Error do ( if SuppressErrors then return e; if err.message == returnMessage From 14766aefd0c012b9188b8acf84815d31b33c87ae Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sat, 26 Oct 2024 16:49:28 -0400 Subject: [PATCH 143/226] Don't use robust "key not found" error when errors are suppressed The robust error message involves calling "alarm", which will cancel any alarms we might be trying to catch using "try" or ??. Closes: #3524 --- M2/Macaulay2/d/hashtables.dd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/M2/Macaulay2/d/hashtables.dd b/M2/Macaulay2/d/hashtables.dd index f8f47635782..ca3018f8beb 100644 --- a/M2/Macaulay2/d/hashtables.dd +++ b/M2/Macaulay2/d/hashtables.dd @@ -318,10 +318,11 @@ lookup(object:HashTable, key:Expr):Expr; -- forward declaration KeyNotFound(object:string, key:Expr):Expr := ( -- TODO: implement a similar trick to call synonym(object) msg := "key not found in " + object; - see := lookup(Class(key), RobustPrintE); - if see != notfoundE then - when applyEEEpointer(see, toExpr(msg), key) - is str:stringCell do msg = str.v else nothing; + if !SuppressErrors then ( + see := lookup(Class(key), RobustPrintE); + if see != notfoundE then + when applyEEEpointer(see, toExpr(msg), key) + is str:stringCell do msg = str.v else nothing); buildErrorPacket(msg)); export lookup1(object:HashTable,key:Expr,keyhash:hash_t):Expr := ( From bf22b29891849b896a7e4c38a9c93de487c576b7 Mon Sep 17 00:00:00 2001 From: n-m-g Date: Sun, 27 Oct 2024 20:36:48 -0300 Subject: [PATCH 144/226] Added file: AbstractSimplicialComplexes.m2 This package gives a way to work with simplicial complexes implemented as graded lists. It complements the existing M2 package SimplicialComplexes.m2. --- .../packages/AbstractSimplicialComplexes.m2 | 832 ++++++++++++++++++ 1 file changed, 832 insertions(+) create mode 100644 M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 diff --git a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 new file mode 100644 index 00000000000..d467153c927 --- /dev/null +++ b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 @@ -0,0 +1,832 @@ +-- -*- coding: utf-8 -*- +-------------------------------------------------------------------------------- +-- Copyright 2024 Nathan Grieve +-- +-- This program is free software: you can redistribute it and/or modify it under +-- the terms of the GNU General Public License as published by the Free Software +-- Foundation, either version 3 of the License, or (at your option) any later +-- version. +-- +-- This program is distributed in the hope that it will be useful, but WITHOUT +-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- +-- You should have received a copy of the GNU General Public License along with +-- this program. If not, see . +-------------------------------------------------------------------------------- + + +newPackage( + "AbstractSimplicialComplexes", + Version => "0.1", + Date => "24 September 2024", + Headline => "AbstractSimplicialComplexes", + Authors => {{ Name => "Nathan Grieve", Email => "nathan.m.grieve@gmail.com", HomePage => "https://sites.google.com/view/nathan-grieve"}}, + AuxiliaryFiles => false, + DebuggingMode => false, + PackageImports => {"Complexes"}, + PackageExports => {"Complexes"} + ) + +export {"AbstractSimplicialComplex", "abstractSimplicialComplex","simplicialChainComplex", "reducedSimplicialChainComplex", "ambientAbstractSimplicialComplexSize", + "ambientAbstractSimplicialComplex", "facets", "randomAbstractSimplicialComplex", "randomSubSimplicialComplex", + "inducedSimplicialChainComplexMap","inducedReducedSimplicialChainComplexMap","areEqual", "dimAbstractSimplicialComplex", + } + +-* Code section *- + +--------------------------------------- +-- spots +---------------------------------------- +-- the spots method is extremely useful +-- but we don't export it +----------------------------------------- + +spots = method() + +spots Complex := List => ( + C -> (c := concentration C; toList(c_0 .. c_1))) + +max Complex := K -> max spots K +min Complex := K -> min spots K + + +--------------------------------------- +-------------------------------------- + +-------------------------- +-- simplicial set +------------------------- + +-- The idea is to make a SimplicalSet as a Type of HashTable as a means +-- For working with AbstractSimplicial Complexes --- +-- The integer keys will output the list of i-simplicies + +AbstractSimplicialComplex = new Type of HashTable +AbstractSimplicialComplex.synonym = "simplicial set" + +AbstractSimplicialComplex.GlobalAssignHook = globalAssignFunction +AbstractSimplicialComplex.GlobalReleaseHook = globalReleaseFunction +describe AbstractSimplicialComplex := K -> net expression K + + +new AbstractSimplicialComplex := AbstractSimplicialComplex =>(cl) -> ( + K := newClass(AbstractSimplicialComplex, new HashTable); -- sigh + K) + +--- It will be better to make some additional keys for this class --- +--- For instance a key ambient, which will be an integer n which specifies the "ambient n-simplex on [n]" +--- That we wish to view the SimplicalSet as being contained in --- +--- This would be slightly different than the ambient size -- i.e., the smallest simplex that contains +--- The given simplicial complex +--- But actually how this is set-up should suffice --- +--- We will also want to make a key "generators" which points to the list of generators used to define +--- We would want to make ``maps" between SimplicalSets + +spots AbstractSimplicialComplex := List => ( + K -> sort select(keys K, i -> class i === ZZ)) + + + +-- This returns the p-faces of a simplicial set + +AbstractSimplicialComplex _ ZZ := AbstractSimplicialComplex => (K,p) -> ( + if K#?p then K#p + ) + +-- given a list of subsets L and A \in L decide if A is maximal + +isMaximal :=(x,L) -> ( +myList := select(L,i -> isSubset(x,i)); +if #myList == 1 then +return true +else return false + ) + +-- select the maximal subsets (i.e., facets) of a list of subsets + +listFacets := (L) -> ( +select(L,i-> isMaximal(i,L)) + ) + + +--- return the facets of a simplicial set + +facets = method() + +facets(AbstractSimplicialComplex) := List => K ->( + L := flatten(apply(spots K, i-> K_i)); + return listFacets(L) + ) + + +--- decide if two simplicial sets are equal + +areEqual = method() + +areEqual(AbstractSimplicialComplex,AbstractSimplicialComplex) := Boolean => (K,L) ->( + return (facets K) == (facets L) + ) + +--- return the dimension of a simplicial set + +dimAbstractSimplicialComplex = method() + +dimAbstractSimplicialComplex(AbstractSimplicialComplex) := ZZ => (K) -> ( + return max apply(facets(K), i -> #i) + ) + + +--- Constructors for AbstractSimplicialComplexs + +abstractSimplicialComplex = method() + +---- We need to make a sort of ``main primitive constructor" for simplicial sets +---- We need to make a method perhaps to check if a simplicial set is a simplicial complex (i.e., to check closure under taking subsets of a face) + + +-- the most basic constructor of a AbstractSimplicialComplex + +-- The idea is to make a simplical set starting from a list of faces. +-- The list of faces need not be facets. +-- The constructor returns the simplicial complex (with all of its faces) that is +-- generated by this list of faces +-- By default, it is assumed that the kfaces are all lex ordered positive integers + +makeKFaces := (L,k) -> ( + toList(set(flatten(apply(#L, i -> subsets(sort L_i,k))))) + ) + +makeAllFaces := (L) -> ( + numberOfFaces := #L; +-- find the highest dimensional face + n := max(apply(numberOfFaces, i-> # (L_i))); + flatten(for k from 0 to n list {k-1 => sort makeKFaces(L,k)}) + ) + + +abstractSimplicialComplex(List) := AbstractSimplicialComplex => L -> ( + return new AbstractSimplicialComplex from makeAllFaces(L) + ) + + +--- The following method will make the (n-1)-dimensional n-simplex on [n] = {1,...,n} +abstractSimplicialComplex(ZZ) := AbstractSimplicialComplex => (n) -> ( + L := for i from 1 to n list i; + return abstractSimplicialComplex({L}) + ) + +--- Make the "r-skeleton" on [n] = {1,...n} + +abstractSimplicialComplex(ZZ,ZZ) := AbstractSimplicialComplex => (n,r) -> ( + return abstractSimplicialComplex subsets(for i from 1 to n list i,r) + ) + +-- + +-- making random simplicial sets -- + +-- make a random subset of {1,...,n} + +randomSubset = method() + +randomSubset(ZZ) := List => (n) -> ( + setRandomSeed(currentTime()); + k := random(1,n); + sort unique (for i from 1 to k list (random(1,n))) + ) + +-- random size r subset -- + +randomSubset(ZZ,ZZ) := List => (n,r) -> ( + setRandomSeed(currentTime()); + sort unique (for i from 1 to r list (random(1,n))) + ) + + +-- make a random subset of a given set + +randomSubset(List) := List => (L) -> ( + setRandomSeed(currentTime()); + n := #L; + k := random(0,n); + mySubset := subsets(L,k); + mySubset_(random(binomial(n,k))) + ) + +-- a variant of this is to make a random k element subset of a given set -- + +-- The following will make a "random" simplicial complex on {1,...,n} -- + +randomAbstractSimplicialComplex = method() + +randomAbstractSimplicialComplex(ZZ) := AbstractSimplicialComplex => (n) -> ( + setRandomSeed(currentTime()); + listLength := 1 + random(2^n); + abstractSimplicialComplex unique(for i from 1 to listLength list randomSubset(n)) + ) + +------ + +-- it likely would also be good to make a randomSimplicial complex +-- on [n] with dimension at most equal to r + +----- + +randomAbstractSimplicialComplex(ZZ,ZZ) := AbstractSimplicialComplex =>(n,r) -> ( + setRandomSeed(currentTime()); + listLength := 1 + random(binomial(n,r)); + abstractSimplicialComplex unique(for i from 1 to listLength list randomSubset(n,r)) + ) + + +-- can we make the random complex Y_d(n,m) which has vertex set +-- [n] and complete (d − 1)-skeleton, and has exactly m d-dimensional faces, +-- chosen at random from all binomial(binomial(n,d+1),m) possibilities. +-- Such random complexes appear in lots of different contexts including in the article +-- COHEN–LENSTRA HEURISTICS FOR TORSION IN HOMOLOGY OF RANDOM COMPLEXES +-- (MATTHEW KAHLE, FRANK H. LUTZ, ANDREW NEWMAN, AND KYLE PARSONS) -- +-- Some additinal testing of this is needed + +randomAbstractSimplicialComplex(ZZ,ZZ,ZZ) := (n,m,d) -> ( + setRandomSeed(currentTime()); + L := for i from 1 to n list i; + dDimlSubsets := subsets(L,d+1); + randomFaces := for i from 1 to m list (dDimlSubsets#(random(binomial(n,d+1)))); + append(append(randomFaces,{L}),subsets(L,d)); + return abstractSimplicialComplex(randomFaces) + ) + +randomSubSimplicialComplex = method() + +randomSubSimplicialComplex(AbstractSimplicialComplex) := AbstractSimplicialComplex => (K) -> ( + setRandomSeed(currentTime()); + L := facets K; + abstractSimplicialComplex unique apply(L, i-> randomSubset(i)) +) + +--- + +-- ambient simplicial set + +ambientAbstractSimplicialComplexSize = method() -- return the size of the underyling ambient simplex + +ambientAbstractSimplicialComplexSize(AbstractSimplicialComplex) := (K) -> ( + max flatten(K_0) + ) + + +ambientAbstractSimplicialComplex = method() -- return the underlying ambient simplex + + +ambientAbstractSimplicialComplex(AbstractSimplicialComplex) := AbstractSimplicialComplex => (K) -> ( + return abstractSimplicialComplex(ambientAbstractSimplicialComplexSize(K)) + ) + +--- +-- Another method that could be added later is a script to check that a proposed "AbstractSimplicialComplex" +-- is indeed a "AbstractSimplicialComplex" i.e., that the closure property on subsets is indeed satisfied +-- this is something that we will postpone for the present time + +--------- + +-- There are many ways to approach +-- The simplical boundary map +-- For X a given simplicial complex +-- Perhaps the most straight forward way +-- is via +-- \partial_k : C_k(X) \rightarrow C_{k-1}(X) +-- Here C_k(X) is the free +-- \ZZ-module (or \kk-vector space) +-- on the set of k+1 simplicies +-- (i.e., the set of k+1 combinations +-- of {1,...,n}) + + +-- There are many ways to approach +-- The simplical boundary map +-- For X a given simplicial complex +-- Perhaps the most straight forward way +-- is via +-- \partial_k : C_k(X) \rightarrow C_{k-1}(X) +-- Here C_k(X) is the free +-- \ZZ-module (or \kk-vector space) +-- on the set of k+1 simplicies +-- (i.e., the set of k+1 combinations +-- of {1,...,n}) + +-- Given input a k+1 lex segment a = [a_0,...,a_k] ---- i.e., a k-face +-- Compute its image under the boundary map +-- It seems most straight forward to give the +-- output as a k+1 tuple with entry i having the +-- form [(-1)^i,d_i(a)] +-- here d_i(a) is a with the i-th lex entry removed +-- the following is more simply just for +-- testing purposes and is not used explicitly in the sequel +--partial := (L) -> ( + -- apply(0 .. (#L-1), i -> {(-1)^i, drop(L,{i,i})}) + + +-- The following function seems useful to +-- useful to construct +-- the simplicial chain complex map +-- given a k-face y and a k+1 - face x +-- decide if it equals \partial(x,i) +-- for some i + + +isDLexSeqI := (y,x) -> ( + k := #y; + sign := 0; + for i from 0 to # x do ( + z := drop(x,{i,i}); + if y == z then (sign = (-1)^i; + break); +); +return sign +) + + + +-- make a constructor for making matrices +-- that represented the simplicial boundary +-- maps of a given simplical complex +-- what follows appears to work OK +-- more testing is required. + +-- make a method for now to allow for additional testing + +simplicialMakeMatrix = method() + +simplicialMakeMatrix(List,List) := (kPlusOneFaces,kFaces) -> ( + n := # kPlusOneFaces; + m := # kFaces; + matrixList := + for i from 0 to m-1 list ( + for j from 0 to n-1 list ( + isDLexSeqI((kFaces)#i,(kPlusOneFaces)#j)) + ); + return matrix(matrixList) +) + + +-- We can finally make the entire reduced homology chain complex in the following way +-- Given as input the simplcial complex represented as a simplicial set -- +-- This will produce the reduced chain complex (so the empty set will +-- appear in the chain complex) + +reducedSimplicialChainComplex = method() -- return the chain complex (with contribution from the empty face) that is associated to a simplicial set (i.e., an abstract simplicial complex) + +reducedSimplicialChainComplex(AbstractSimplicialComplex) := Complex => (L) -> +( + n := max spots L; + if n == -1 then (return complex hashTable {-1 => map(ZZ^0,ZZ^1,zero)}) + else( + mapsList := for i from 0 to n list (i => simplicialMakeMatrix(L#i,L#(i-1))); + append(mapsList,-1 => map(ZZ^0,target(mapsList#0)#1,zero));); + return complex hashTable mapsList + ) + +simplicialChainComplex = method() -- return the non-reduced simplicial chain complex (i.e., the chain complex with no contribution from the empty face) + +simplicialChainComplex(AbstractSimplicialComplex) := Complex => (L) -> +( + return(naiveTruncation(reducedSimplicialChainComplex L, 0, infinity)) + ) + +--- Another method that would be of interest, +-- is to give an inclusion (or more general a morphism) +---- of simplicial sets, then compute the induced chain complex morphism of SimplicialChainComplexes +--- An important special case would be to view a +-- sub simplicial set of the full simplicial set (simplex) and then to compute +--- the corresponding induced inclusion morphism. + +--- A first step is to make an k-face inclusion map given an inclusion of simplicial sets +--- Assume that L <= H +--- If L_k has no faces then the method returns an error message +--- Otherwise the method produces the appropriate matrix +--- That induces the corresponding inclusion map + +--- This seems to work on some examples but needs to be tested more + +inducedKFaceSimplicialChainComplexMap = method() + +inducedKFaceSimplicialChainComplexMap(ZZ,AbstractSimplicialComplex,AbstractSimplicialComplex) := (k,H,L) -> +( +M := L_k; +N := H_k; +n := # M; +m := # N; +myMatrixList := for i from 0 to m-1 list ( + for j from 0 to n-1 list ( + if N#i == M#j then 1 else 0 + ) + ); +return matrix myMatrixList +) + + + +--If H <= L then give the induced chain complex map for (non-reduced) simplicalChainComplexes + +inducedSimplicialChainComplexMap = method() + +inducedSimplicialChainComplexMap(AbstractSimplicialComplex,AbstractSimplicialComplex) := (L,H) -> +( + h := simplicialChainComplex H; + l := simplicialChainComplex L; + f := hashTable apply(spots h, i -> if i == -1 then i => map(ZZ^0,ZZ^0,zero) else i => inducedKFaceSimplicialChainComplexMap(i,L,H)); + return map(l,h,f); + ) + +--If H <= L then give the induced chain complex map for reduced simplicalChainComplexes + +inducedReducedSimplicialChainComplexMap = method() + +inducedReducedSimplicialChainComplexMap(AbstractSimplicialComplex,AbstractSimplicialComplex) := (L,H) -> ( + h := reducedSimplicialChainComplex H; + l := reducedSimplicialChainComplex L; + f := hashTable apply(spots h, i -> if i == -1 then i => map(l_(-1),h_(-1),id_(h_(-1))) else i => inducedKFaceSimplicialChainComplexMap(i,L,H)); + return map(l,h,f); + ) + + +----- + +-* Documentation section *- +beginDocumentation() + +document { + Key => AbstractSimplicialComplexes, + Headline => "a package for working with abstract simplicial complexes", + "In this package, by a slight abuse of termionalogy we mostly refer to abstract simplicial complexes as 'AbstractSimplicialComplexs'. By our viewpoint, `abstract simplicial complexes' have vertices +supported on the set [n] := {1,...,n}. + The aim of this package is to provide a methology for working with such objects directly. We are especially interested in homological aspects thereof; in particular +we provide methods for working with the chain complexes that are associated to each abstract simplicial complex.", + + SUBSECTION "An overview of this package", + UL { + TO "How to make abstract simplicial complexes", + TO "How to make reduced and non-reduced simplicial chain complexes", + TO "How to make subsimpliical complexes and induced simplicial chain complex maps", + }, +} + + +-------------------------------------------- +-- Package overview examples --------------- +-------------------------------------------- + +doc /// + Key + "How to make abstract simplicial complexes" + Headline + Using the type AbstractSimplicialComplexs to represent abstract simplicial complexes + Description + Text + The type AbstractSimplicialComplex is a data type for working with + abstract simplicial complexes with vertices supported on [n] = {1,...,n}. + Here we illustrate some of the most basic ways to interact with this data type. + Text + The simplicial complex that is generated by {1,2,3,4}, {2,3,5} and {1,5} can be + constructed in the following way. + Example + abstractSimplicialComplex({{1,2,3,4}, {2,3,5},{1,5}}) + Text + The simplex on the vertex set [4] can be constructed as + Example + abstractSimplicialComplex(4) +/// + + + +doc /// + Key + "How to make reduced and non-reduced simplicial chain complexes" + Headline + Simplicial homological constructors + Description + Text + Non-reduced and reduced simplicial chain complexes can be constructed in the following way. + This is illustrated in the following way. + Example + K = abstractSimplicialComplex({{1,2,3,4}, {2,3,5},{1,5}}) + k = simplicialChainComplex K + k.dd + kRed = reducedSimplicialChainComplex K + kRed.dd +/// + +doc /// + Key + "How to make subsimplical complexes and induced simplicial chain complex maps" + Headline + Induced simplicial chain complex maps via subsimplicial complexes + Description + Text + Given a subsimplicial complex there are induced simplicial chain complex maps. + can be used to make non-reduced and reduced simplicial chain complexes. + This is illustrated in the following way. + Example + K = randomAbstractSimplicialComplex(4) + randomSubSimplicialComplex(K) + facets(K) +/// + +doc /// + Key + "Calculations with random simplicial complexes" + Headline + Homological calculations on random simplicial complexes + Description + Text + In what follows we illustrate a collection of homological calculations that + can be performed on random simplicial complexes. +/// + + + +-------------------------------------------- +-- Documentation of methods and functions -- +-------------------------------------------- + +-- +-- Types +-- + +doc /// + Key + AbstractSimplicialComplex + Headline + the type of all simplicial sets + Description + Text + The type AbstractSimplicialComplex is a data type for working with + abstract simplicial complexes with vertices supported on [n] = {1,...,n}. +/// + + +-- +-- Functions and Commands +-- + +doc /// + Key + areEqual + (areEqual,AbstractSimplicialComplex,AbstractSimplicialComplex) + Headline + Decide if two simplicial sets are equal + Description + Text + Decides if two simplicial sets are equal + Example + areEqual(randomAbstractSimplicialComplex(4),randomAbstractSimplicialComplex(4)) +/// + +doc /// + Key + randomAbstractSimplicialComplex + (randomAbstractSimplicialComplex,ZZ) + (randomAbstractSimplicialComplex,ZZ,ZZ) + (randomAbstractSimplicialComplex,ZZ,ZZ) + Headline + Create a random simplicial set + Description + Text + Creates a random abstract simplicial complex with vertices supported on a subset of [n] = {1,...,n} + Example + setRandomSeed(currentTime()); + K = randomAbstractSimplicialComplex(4) + SeeAlso + "random" + "randomSquareFreeMonomialIdeal" +/// + +doc /// + Key + randomSubSimplicialComplex + (randomSubSimplicialComplex,AbstractSimplicialComplex) + Headline + Create a random sub-simplicial set + Description + Text + Creates a random sub-simplicial complex of a given simplicial complex + Example + K = randomAbstractSimplicialComplex(4) + J = randomSubSimplicialComplex(K) +/// + + +doc /// + Key + ambientAbstractSimplicialComplex + (ambientAbstractSimplicialComplex,AbstractSimplicialComplex) + Headline + the ambient simplex + Description + Text + If an abstract simplicial complex has vertices supported on a subset of [n] = {1,...,n}, and including n, + then it seems useful to regard this simplicial complex as being a subsimplicial + complex of the simplex on [n]. This method returns this simplex as + the ambient simplical complex. + Example + K = abstractSimplicialComplex({{1,2},{3}}) + J = ambientAbstractSimplicialComplex(K) +/// + + +doc /// + Key + ambientAbstractSimplicialComplexSize + (ambientAbstractSimplicialComplexSize,AbstractSimplicialComplex) + Headline + the ambient simplex size + Description + Text + If an abstract simplicial complex has vertices supported on a subset of [n] = {1,...,n], and including n, + then it seems useful to regard this simplicial complex as being a subsimplicial + complex of the simplex on [n]. This method simply returns this largest integer n. + Example + K = abstractSimplicialComplex({{1,2},{3}}) + J = ambientAbstractSimplicialComplexSize(K) +/// + + + +doc /// + Key + inducedSimplicialChainComplexMap + (inducedSimplicialChainComplexMap,AbstractSimplicialComplex,AbstractSimplicialComplex) + Headline + induced maps that arise via inclusions of abstract simplicial complexes + Description + Text + If an abstract simplicial complex can be regarded as a subsimplicial complex of another + abstract simplicial complex, then it is useful to calculate the induced map at the level of + Simplicial Chain Complexes. This is made + possible by the method inducedSimplicialChainComplexMap. + Example + K = abstractSimplicialComplex({{1,2},{3}}) + J = ambientAbstractSimplicialComplex(K) + inducedSimplicialChainComplexMap(J,K) +/// + +doc /// + Key + inducedReducedSimplicialChainComplexMap + (inducedReducedSimplicialChainComplexMap,AbstractSimplicialComplex,AbstractSimplicialComplex) + Headline + induced maps that arise via inclusions of abstract simplicial complexes + Description + Text + If an abstract simplicial complex can be regarded as a subsimplicial complex of another + abstract simplicial complex, then it is useful to calculate the induced map at the level of + Reduced Simplicial Chain Complexes. This is made + possible by the method inducedReducedSimplicialChainComplexMap. + Example + K = abstractSimplicialComplex({{1,2},{3}}) + J = ambientAbstractSimplicialComplex(K) + inducedReducedSimplicialChainComplexMap(J,K) +/// + + + +doc /// + Key + reducedSimplicialChainComplex + (reducedSimplicialChainComplex,AbstractSimplicialComplex) + Headline + The reduced homological chain complex that is determined by an abstract simplicial complex + Description + Text + This method returns the reduced homological chain complex (i.e., there is a nonzero term in + homological degree -1 that corresponds to the empty face) that is asociated + to an abstract simplicial complex. The chain complex is defined over the integers. + Example + K = abstractSimplicialComplex({{1,2,3},{2,4,9},{1,2,3,5,7,8},{3,4}}) + reducedSimplicialChainComplex(K) +/// + +doc /// + Key + simplicialChainComplex + (simplicialChainComplex,AbstractSimplicialComplex) + Headline + The non-reduced homological chain complex that is determined by an abstract simplicial complex + Description + Text + This method returns the (non-reduced) homological chain complex (i.e., there is no nonzero term in + homological degree -1 that corresponds to the empty face) that is asociated + to an abstract simplicial complex. The chain complex is defined over the integers. + Example + K = abstractSimplicialComplex({{1,2,3},{1,4,5},{2,4,5,7}}) + C = simplicialChainComplex(K) +/// + +doc /// + Key + abstractSimplicialComplex + (abstractSimplicialComplex,List) + (abstractSimplicialComplex,ZZ) + Headline + The abstractSimplicialComplex that is determined by an abstract simplicial complex + Description + Text + This method returns the AbstractSimplicialComplex that represents a + given abstract simplicial complex. + The input is either a given collection of generating faces or an integer. + These facets need not + be facets. Moreover, the elements of the faces need not be written + in lexiographic order. When the input is an integer, the output is the + corresponding simplex. + Example + abstractSimplicialComplex({{1,2,3,4}}) + abstractSimplicialComplex({{4,1,2,3}, {3,2,5},{1,5}}) + abstractSimplicialComplex(4) +/// + +doc /// + Key + (symbol _, AbstractSimplicialComplex, ZZ) + Headline + The k faces of a simplicial set + Description + Text + This method returns the collection of k faces of a given AbstractSimplicialComplex. + Example + K = abstractSimplicialComplex(3) + K_3 + K_2 + K_1 + K_0 + K_(-1) +/// + +doc /// + Key + facets + (facets, AbstractSimplicialComplex) + Headline + The facets of a simplicial set + Description + Text + This method returns the collection of facets of a given AbstractSimplicialComplex. + Example + K = abstractSimplicialComplex(3) + facets K +/// + +doc /// + Key + dimAbstractSimplicialComplex + (dimAbstractSimplicialComplex, AbstractSimplicialComplex) + Headline + The dimension of a simplicial complex + Description + Text + This method returns the dimension a given AbstractSimplicialComplex. + Example + K = abstractSimplicialComplex(3) + dimAbstractSimplicialComplex K +/// + + + +doc /// + Key + (describe, AbstractSimplicialComplex) + Headline + real description + Usage + describe S + Description + Text + see describe + SeeAlso + describe +/// + + +-* Test section *- +TEST /// -* [insert short title for this test] *- +-- test code and assertions here +-- may have as many TEST sections as needed +/// + +end-- + +-* Development section *- + +-- +-- + +restart +uninstallPackage "AbstractSimplicialComplexes" +installPackage("AbstractSimplicialComplexes", RemakeAllDocumentation => true) +check "AbstractSimplicialComplexes" +viewHelp"AbstractSimplicialComplexes" + +-- +-- + From f99a07cdebdf4db9112513bece5cba6c37564e49 Mon Sep 17 00:00:00 2001 From: Sean Grate Date: Sun, 27 Oct 2024 22:26:15 -0500 Subject: [PATCH 145/226] Renamed some methods, added permutation indexing on matrices, more docs --- M2/Macaulay2/packages/Permutations.m2 | 25 +- M2/Macaulay2/packages/Permutations/docs.m2 | 296 ++++++++++++++++---- M2/Macaulay2/packages/Permutations/tests.m2 | 22 +- 3 files changed, 261 insertions(+), 82 deletions(-) diff --git a/M2/Macaulay2/packages/Permutations.m2 b/M2/Macaulay2/packages/Permutations.m2 index a0a927c4e99..1caab5f06d9 100644 --- a/M2/Macaulay2/packages/Permutations.m2 +++ b/M2/Macaulay2/packages/Permutations.m2 @@ -17,7 +17,6 @@ export { "Permutation", -- methods "permutation", - "toMatrix", "cycleDecomposition", "cycleType", "ascents", @@ -62,7 +61,7 @@ Permutation.synonym = "permutation" new Permutation from VisibleList := (typeofPermutation,w) -> w permutation = method() -permutation List := Permutation => w -> new Permutation from w +permutation VisibleList := Permutation => w -> new Permutation from w isWellDefined Permutation := Boolean => w -> ( wList := toList w; @@ -121,25 +120,28 @@ Permutation ^ ZZ := Permutation => (w, n) -> fold(if n < 0 then (-n):(permutatio -- Matrix representation of a permutation ------------------------------------ -- some people prefer the transpose of this -toMatrix = method(TypicalValue => Matrix) -toMatrix Permutation := w -> ( +matrix Permutation := Matrix => o -> w -> ( id_(ZZ^(#w))_(to0Index toList w) ) ------------------------------------ -- Group actions ------------------------------------ -Permutation * List := List => (w, l) -> ( +Permutation * VisibleList := VisibleList => (w, l) -> ( if #(trim w) > #l then error(toString w | " permutes more than " | toString #l | " elements.") else l_(to0Index toList extend(w, #l)) ) --- group action on a matrix permutes the ROWS of the matrix --- maybe would prefer to permute the columns? Seems more natural +VisibleList _ Permutation := VisibleList => (l, w) -> (w*l) + +-- group action on a matrix permutes the rows/columns of the matrix Permutation * Matrix := Matrix => (w, M) -> ( m := numRows M; if #(trim w) > m then error(toString w | " permutes more than " | toString m | " elements.") - else (toMatrix extend(w, m)) * M + else (matrix extend(w, m)) * M ) +Matrix _ Permutation := Matrix => (M, w) -> (w*M) +Matrix * Permutation := Matrix => (M, w) -> (transpose(w*(transpose M))) +Matrix ^ Permutation := Matrix => (M, w) -> (M*w) ------------------------------------ -- Cycle decomposition of a permutation @@ -356,7 +358,7 @@ length Permutation := ZZ => w -> (#(inversions w)) ----------------------------------------------------------------------------- -- **DOCUMENTATION** -- ----------------------------------------------------------------------------- -beginDocumentation() +beginDocumentation() load "./Permutations/docs.m2" ----------------------------------------------------------------------------- @@ -365,11 +367,6 @@ load "./Permutations/docs.m2" load "./Permutations/tests.m2" end ------------------------------------------------------------------------------ --- **SCRATCH SPACE** -- ------------------------------------------------------------------------------ - - ----------------------------------------------------------------------------- --Development Section ----------------------------------------------------------------------------- diff --git a/M2/Macaulay2/packages/Permutations/docs.m2 b/M2/Macaulay2/packages/Permutations/docs.m2 index c99b67a73af..25f927ffa13 100644 --- a/M2/Macaulay2/packages/Permutations/docs.m2 +++ b/M2/Macaulay2/packages/Permutations/docs.m2 @@ -1,8 +1,19 @@ -- Sean Grate +doc /// + Key + "Permutations" + Headline + a package which implements permutations + Description + Text + This package defines the @TO Permutation@ type. An overview of the package's + can be found in the @TO "Permutations Guide"@. +/// + doc /// Key - "permutations" + "Permutations Guide" Headline a detailed overview of permutations in Macaulay2 Description @@ -36,12 +47,12 @@ doc /// Permutations must be constructed from lists consisting of only the integers $1 \textemdash n$. If a list contains any other elements or does not consist of the entire range, then an error is thrown. - The method @TO toMatrix@ can be used to get the matrix representation of the + The method @TO matrix@ can be used to get the matrix representation of the permutation. In this representation, for a permutation $p$, if $p(i)=j$, then then the $(i,j)$th entry is $1$. Example p = permutation {3,1,2,4,5} - toMatrix p + matrix p Text This is especially useful for considering the action of permutations on matrices, see {\bf Group actions}. @@ -87,7 +98,7 @@ doc /// p*L Text A permutation $p$ on $n$ symbols can also be regarded as a permutation on $N$ - symbols for any $N \geq n$ by regarding all of the indices $n+1, n+2, \hdots$ + symbols for any $N \geq n$ by regarding all of the indices $n+1, n+2, \dots$ as fixed by $p$, i.e., $p(i)=i$ for all $i > n$. This is also reflected in the group action. Example @@ -96,10 +107,9 @@ doc /// p*L Text In a similar manner, permutations on $n$ symbols also act on the space of - $n \times n$ matrices by permuting the rows (or columns). For us, this group - action is reflected via permutation of the rows of the matrix. Another way to + $m \times n$ matrices by permuting the rows (or columns). Another way to view this action is via the multiplication on the left by the matrix representation - of the permutation. + of the permutation (if acting on the rows). Example p = permutation {3,1,2}; M = id_(ZZ^3); @@ -120,6 +130,14 @@ doc /// N = matrix {{1,0},{0,1},{1,1}}; p*M p*N + Text + We can also act on the columns of the matrix in a similar way. + Example + p = permutation {3,1,2}; + M = id_(ZZ^3) || id_(ZZ^3); + N = matrix {{1,0,0,0},{0,1,0,0},{0,0,1,0}}; + M*p + N*p -- Text @@ -138,7 +156,7 @@ doc /// 1. each cycle is listed with its largest element first, and @BR{}@ 2. the cycles are listed in increasing order. - A permutation's \emph{cycle type} is the sequence consisting of the lengths of the + A permutation's {\em cycle type} is the sequence consisting of the lengths of the cycles in its cycle decomposition, listed in weakly decreasing order. Example cycleType p @@ -148,8 +166,8 @@ doc /// {\bf Ascents, descents, runs, exceedances, saliances, and records.} - A permutation $p=(p_1 \, \hdots \, p_n)$ has an \emph{ascent} at $i$ (for $i < n$) - if $p(i) < p(i+1)$. Similarly, it has a \emph{descent} at $i$ (for $i < n$) if + A permutation $p=(p_1 \, \dots \, p_n)$ has an {\em ascent} at $i$ (for $i < n$) + if $p(i) < p(i+1)$. Similarly, it has a {\em descent} at $i$ (for $i < n$) if $p(i) > p(i+1)$. We can compute the set of ascents and the set of descents using {\tt ascents} and {\tt descents}, respectively. Example @@ -157,27 +175,27 @@ doc /// ascents p descents p Text - An \emph{ascending run} is a maximal subsequence of successive ascents. - Similarly, a \emph{descending run} is a maximal subsequence of successive + An {\em ascending run} is a maximal subsequence of successive ascents. + Similarly, a {\em descending run} is a maximal subsequence of successive descents. Example p = permutation {3,1,2,5,4}; ascendingRuns p descendingRuns p Text - A permutation $p=(p_1 \, \hdots \, p_n)$ has an \emph{exceedance} at $i$ if - $p(i) > i$; this is called a \emph{weak exceedance} if the inequality is not + A permutation $p=(p_1 \, \dots \, p_n)$ has an {\em exceedance} at $i$ if + $p(i) > i$; this is called a {\em weak exceedance} if the inequality is not strict, i.e., $p(i) \geq i$. Example p = permutation {3,1,2,5,4}; exceedances p Text - A permutation $p$ has a {\emph saliance} at $i$ if $p(j) < p(i)$ for all $j > i$. + A permutation $p$ has a {\em saliance} at $i$ if $p(j) < p(i)$ for all $j > i$. Example p = permutation {3,1,2,5,4}; saliances p Text - A permutation $p$ has a \emph{record} at $i$ if $p(j) < p(i)$ for all $j < i$. + A permutation $p$ has a {\em record} at $i$ if $p(j) < p(i)$ for all $j < i$. Example p = permutation {3,1,2,5,4}; records p @@ -195,7 +213,7 @@ doc /// avoidsPattern(p, {2,1,4,3}) Text Some patterns are common enough that those pattern-avoiding permutations - are given a name, such as \emph{vexillary} for those that are $2143$-avoiding. + are given a name, such as {\em vexillary} for those that are $2143$-avoiding. Example p = permutation {3,1,2,5,4}; isVexillary p @@ -232,28 +250,28 @@ doc /// {\bf Miscellaneous.} - We can compute the \emph{inverse} of a permutation. + We can compute the {\em inverse} of a permutation. Example p = permutation {3,1,2,5,4}; inverse p Text - The \emph{order} of a permutation $p$ is its order in the symmetric group $\mathfrak{S}_n$, i.e., + The {\em order} of a permutation $p$ is its order in the symmetric group $\mathfrak{S}_n$, i.e., the smallest positive integer $k$ such that $p^k$ is the identity permutation. Example p = permutation {3,1,2,5,4}; ord p Text - Every permutation can be written as a product of transpositions. One definition for the \emph{sign} + Every permutation can be written as a product of transpositions. One definition for the {\em sign} of a permutation $p$ is $1$ if it can be written as a product of an even number of transpositions and is $-1$ if it can be written as an odd number of transpositions. If $\text{sign}(p) = 1$, - the permutation is called \emph{even} and if $\text{sign}(p) = -1 $, it is called \emph{pdd}. + the permutation is called {\em even} and if $\text{sign}(p) = -1 $, it is called {\em pdd}. Example p = permutation {3,1,2,5,4}; sign p isEven p isOdd p Text - A permutation $p$ is a \emph{derangement} if $p(i) \neq i$ for all $i$. + A permutation $p$ is a {\em derangement} if $p(i) \neq i$ for all $i$. We can determine if $p$ is a derangement as well its fixed points. Example p = permutation {3,1,2,5,4}; @@ -269,9 +287,13 @@ doc /// (symbol _, Permutation, ZZ) (symbol _, Permutation, List) (symbol _, Permutation, Sequence) + (symbol _, VisibleList, Permutation) (symbol ==, Permutation, Permutation) - (symbol *, Permutation, List) + (symbol *, Permutation, VisibleList) (symbol *, Permutation, Matrix) + (symbol *, Matrix, Permutation) + (symbol _, Matrix, Permutation) + (symbol ^, Matrix, Permutation) (symbol *, Permutation, Permutation) (symbol ^, Permutation, ZZ) ascendingRuns @@ -300,7 +322,27 @@ doc /// trim saliances sign - toMatrix + (matrix, Permutation) +/// + +-- Permutation +-- (permutation, VisibleList) +doc /// + Key + Permutation + (permutation, VisibleList) + Headline + the Permutation type + Description + Text + Permutations are constructed from lists. To create a permutation, + use the {\tt permutation} method. + Example + p = permutation {3,1,2,4,5} + Text + Permutations must be constructed from lists consisting of only the integers + $1 \dots n$. If a list contains any other elements or does not consist of + the entire range, then an error is thrown. /// -- (symbol _, Permutation, ZZ) @@ -411,25 +453,25 @@ doc /// p == q /// --- (symbol *, Permutation, List) +-- (symbol *, Permutation, VisibleList) doc /// Key - (symbol *, Permutation, List) + (symbol *, Permutation, VisibleList) Headline computes the action of a permutation on a list Usage w * l Inputs w:Permutation - l:List + l:VisibleList Outputs - :List + :VisibleList Description Text A permutation $p$ acts on the elements of list by permuting the elements of the list according to the permutation. More precisely, if - $L = \{ e_1, \hdots, e_k \}$ is a list and $p=(p_1, \hdots, p_n)$ is a - permutation, then the action is given by $p*L = \{ e_{p(1)}, \hdots, e_{p(k)}}$. + $L = \{ e_1, \dots, e_k \}$ is a list and $p=(p_1, \dots, p_n)$ is a + permutation, then the action is given by $p*L = \{ e_{p(1)}, \dots, e_{p(k)}}$. The permutation cannot permute more than {\tt #l} elements. Example @@ -442,6 +484,43 @@ doc /// p = permutation {3,1,2,4,5} L = {3,1,2,5,4,6,7} p * L + SeeAlso + (symbol _, VisibleList, Permutation) +/// + +-- (symbol _, VisibleList, Permutation) +doc /// + Key + (symbol _, VisibleList, Permutation) + Headline + computes the action of a permutation on a list + Usage + l_p + Inputs + l:VisibleList + w:Permutation + Outputs + :VisibleList + Description + Text + A permutation $p$ acts on the elements of list by permuting the elements + of the list according to the permutation. More precisely, if + $L = \{ e_1, \dots, e_k \}$ is a list and $p=(p_1, \dots, p_n)$ is a + permutation, then the action is given by $p*L = \{ e_{p(1)}, \dots, e_{p(k)}}$. + + The permutation cannot permute more than {\tt #l} elements. + Example + p = permutation {3,1,2,5,4,7,6} + L = {3,1,2,5,4,6,7} + L_p + Text + The permutation can be a permutation on less than {\tt #l} elements. + Example + p = permutation {3,1,2,4,5} + L = {3,1,2,5,4,6,7} + L_p + SeeAlso + (symbol *, Permutation, VisibleList) /// -- (symbol *, Permutation, Matrix) @@ -449,7 +528,7 @@ doc /// Key (symbol *, Permutation, Matrix) Headline - computes the action of a permutation on a matrix + computes the action of a permutation on the rows of a matrix Usage w * M Inputs @@ -470,9 +549,110 @@ doc /// Text The permutation can be a permutation on less than {\tt numRows M} elements. Example - p = permutation {3,1,2} + p = permutation {2,1} A = matrix {{1,2},{3,4},{5,6}} p * A + SeeAlso + (symbol _, Matrix, Permutation) +/// + +-- (symbol _, Matrix, Permutation) +doc /// + Key + (symbol _, Matrix, Permutation) + Headline + computes the action of a permutation on the rows of a matrix + Usage + w * M + Inputs + M:Matrix + w:Permutation + Outputs + :Matrix + Description + Text + A permutation $p \in \mathfrak{S}_m$ acts on the space of $m \times n$ matrices by permuting + the rows of the matrix according to the permutation. + + The permutation cannot permute more than {\tt numRows M} elements. + Example + p = permutation {3,1,2} + A = matrix {{1,2,3},{4,5,6},{7,8,9}} + p * A + Text + The permutation can be a permutation on less than {\tt numRows M} elements. + Example + p = permutation {2,1} + A = matrix {{1,2},{3,4},{5,6}} + A_p + SeeAlso + (symbol *, Permutation, Matrix) +/// + +-- (symbol *, Matrix, Permutation) +doc /// + Key + (symbol *, Matrix, Permutation) + Headline + computes the action of a permutation on the columns of a matrix + Usage + M * w + Inputs + M:Matrix + w:Permutation + Outputs + :Matrix + Description + Text + A permutation $p \in \mathfrak{S}_n$ acts on the space of $m \times n$ matrices by permuting + the columns of the matrix according to the permutation. + + The permutation cannot permute more than {\tt numColumns M} elements. + Example + p = permutation {3,1,2} + A = matrix {{1,2,3},{4,5,6},{7,8,9}} + A * p + Text + The permutation can be a permutation on less than {\tt numColumns M} elements. + Example + p = permutation {2,1} + A = matrix {{1,2,3},{4,5,6}} + A * p + SeeAlso + (symbol ^, Matrix, Permutation) +/// + +-- (symbol ^, Matrix, Permutation) +doc /// + Key + (symbol ^, Matrix, Permutation) + Headline + computes the action of a permutation on a matrix + Usage + M^w + Inputs + M:Matrix + w:Permutation + Outputs + :Matrix + Description + Text + A permutation $p \in \mathfrak{S}_n$ acts on the space of $m \times n$ matrices by permuting + the columns of the matrix according to the permutation. + + The permutation cannot permute more than {\tt numColumns M} elements. + Example + p = permutation {3,1,2} + A = matrix {{1,2,3},{4,5,6},{7,8,9}} + A^p + Text + The permutation can be a permutation on less than {\tt numColumns M} elements. + Example + p = permutation {2,1} + A = matrix {{1,2,3},{4,5,6}} + A^p + SeeAlso + (symbol *, Matrix, Permutation) /// -- (symbol *, Permutation, Permutation) @@ -542,7 +722,7 @@ doc /// allRuns:List Description Text - An \emph{ascending run} is a maximal subsequence of successive ascents. + An {\em ascending run} is a maximal subsequence of successive ascents. Example p = permutation {3,1,2,5,4} ascendingRuns p @@ -570,7 +750,7 @@ doc /// :List Description Text - A permutation $p=(p_1 \, \hdots \, p_n)$ has an \emph{ascent} at $i$ (for $i < n$) + A permutation $p=(p_1 \, \dots \, p_n)$ has an {\em ascent} at $i$ (for $i < n$) if $p(i) < p(i+1)$. Example p = permutation {3,1,2,5,4} @@ -683,7 +863,7 @@ doc /// :Sequence Description Text - A permutation's \emph{cycle type} is the sequence consisting of the lengths of the + A permutation's {\em cycle type} is the sequence consisting of the lengths of the cycles in its cycle decomposition, listed in weakly decreasing order. Example p = permutation {3,1,2,5,4} @@ -707,7 +887,7 @@ doc /// allRuns:List Description Text - A \emph{descending run} is a maximal subsequence of successive descents. + A {\em descending run} is a maximal subsequence of successive descents. Example p = permutation {3,1,2,5,4} descendingRuns p @@ -735,7 +915,7 @@ doc /// :List Description Text - A permutation $p=(p_1 \, \hdots \, p_n)$ has a \emph{descent} at $i$ (for $i < n$) + A permutation $p=(p_1 \, \dots \, p_n)$ has a {\em descent} at $i$ (for $i < n$) if $p(i) > p(i+1)$. Example p = permutation {3,1,2,5,4} @@ -766,13 +946,13 @@ doc /// :List Description Text - A permutation $p=(p_1 \, \hdots \, p_n)$ has an \emph{exceedance} at $i$ if + A permutation $p=(p_1 \, \dots \, p_n)$ has an {\em exceedance} at $i$ if $p(i) > i$. Example p = permutation {3,1,2,5,4} exceedances p Text - This is called a \emph{weak exceedance} if the inequality is not + This is called a {\em weak exceedance} if the inequality is not strict, i.e., $p(i) \geq i$. Example p = permutation {3,1,2,5,4} @@ -830,7 +1010,7 @@ Description Text For ease, we can also extend two permutations so that they are regarded as permutations on the same number of symbols. More precisely, if we have - permutations $p=(p_1, \hdots, p_n)$ and $q=(q_1, \hdots, q_m)$, then + permutations $p=(p_1, \dots, p_n)$ and $q=(q_1, \dots, q_m)$, then {\tt extend(p,q)} will return both $p$ and $q$ as permutations on $\text{max}(m,n)$ symbols. Example @@ -858,7 +1038,7 @@ doc /// :List Description Text - A permutation $p$ has a {\emph fixed point} at $i$ if $p(i) = i$. + A permutation $p$ has a {\em fixed point} at $i$ if $p(i) = i$. {\tt fixedPoints} computes all of the fixed points of a permutation. Example p = permutation {2,1,3,5,4} @@ -925,7 +1105,7 @@ doc /// :List Description Text - A permutation $p$ has an {\emph inversion} $(i,j)$ if $i < j$ and $p(i) > p(j)$. + A permutation $p$ has an {\em inversion} $(i,j)$ if $i < j$ and $p(i) > p(j)$. {\tt inversions} computes all of the inversions of a permutation. Example p = permutation {3,1,2,5,4} @@ -950,7 +1130,7 @@ doc /// :Boolean Description Text - A permutation $p$ is {\emph Cartwright-Sturmfels} if it avoids. + A permutation $p$ is {\em Cartwright-Sturmfels} if it avoids. Example p = permutation {3,1,2,5,4} isCartwrightSturmfels p @@ -978,7 +1158,7 @@ doc /// :Boolean Description Text - A permutation $p$ is {\emph CDG} if it avoids. + A permutation $p$ is {\em CDG} if it avoids. Example p = permutation {3,1,2,5,4} isCDG p @@ -1004,7 +1184,7 @@ doc /// :Boolean Description Text - A permutation $p$ is a {\emph derangement} if it has no fixed points. + A permutation $p$ is a {\em derangement} if it has no fixed points. Example p = permutation {3,1,2,5,4} isDerangement p @@ -1027,7 +1207,7 @@ doc /// :Boolean Description Text - A permutation $p$ is {\emph even} if it can be written as a product of an + A permutation $p$ is {\em even} if it can be written as a product of an even number of transpositions. Equivalently, a permutation is even if its @TO sign@ is $1$. Example @@ -1053,7 +1233,7 @@ doc /// :Boolean Description Text - A permutation $p$ is {\emph odd} if it can be written as a product of an + A permutation $p$ is {\em odd} if it can be written as a product of an odd number of transpositions. Equivalently, a permutation is odd if its @TO sign@ is $-1$. Example @@ -1104,7 +1284,7 @@ doc /// :Boolean Description Text - A permutation $p$ is {\emph vexillary} if it is $2143$-avoiding. + A permutation $p$ is {\em vexillary} if it is $2143$-avoiding. Example p = permutation {3,1,2,5,4} isVexillary p @@ -1129,7 +1309,7 @@ doc /// :ZZ Description Text - The {\emph length} of a permutation is the size of its inversion set. + The {\em length} of a permutation is the size of its inversion set. Example p = permutation {3,1,2,5,4} length p @@ -1152,7 +1332,7 @@ doc /// :ZZ Description Text - The {\emph order} of a permutation $p$ is the smallest positive integer + The {\em order} of a permutation $p$ is the smallest positive integer $n$ such that $p^n$ is the identity permutation, i.e., its order in the symmetric group. Example @@ -1175,7 +1355,7 @@ doc /// :List Description Text - A permutation $p$ has a {\emph record} at $i$ if $p(j) < p(i)$ for all $j < i$. + A permutation $p$ has a {\em record} at $i$ if $p(j) < p(i)$ for all $j < i$. Example p = permutation {3,1,2,5,4} saliances p @@ -1229,7 +1409,7 @@ doc /// :List Description Text - A permutation $p$ has a {\emph saliance} at $i$ if $p(j) < p(i)$ for all $j > i$. + A permutation $p$ has a {\em saliance} at $i$ if $p(j) < p(i)$ for all $j > i$. Example p = permutation {3,1,2,5,4} saliances p @@ -1257,7 +1437,7 @@ doc /// :ZZ Description Text - Every permutation can be written as a product of transpositions. One definition for the \emph{sign} + Every permutation can be written as a product of transpositions. One definition for the {\em sign} of a permutation $p$ is $1$ if it can be written as a product of an even number of transpositions and is $-1$ if it can be written as an odd number of transpositions. Example @@ -1270,15 +1450,14 @@ doc /// isOdd /// --- toMatrix +-- (matrix, Permutation) doc /// Key - toMatrix - (toMatrix, Permutation) + (matrix, Permutation) Headline computes the matrix representation of a permutation Usage - toMatrix w + matrix w Inputs w:Permutation Outputs @@ -1290,7 +1469,8 @@ doc /// and $0$ otherwise. Example p = permutation {3,1,2,5,4} - toMatrix p + matrix p SeeAlso (symbol *, Permutation, Matrix) + (symbol *, Matrix, Permutation) /// diff --git a/M2/Macaulay2/packages/Permutations/tests.m2 b/M2/Macaulay2/packages/Permutations/tests.m2 index ab20313c751..e9b519541b6 100644 --- a/M2/Macaulay2/packages/Permutations/tests.m2 +++ b/M2/Macaulay2/packages/Permutations/tests.m2 @@ -90,8 +90,8 @@ TEST /// extendedList = toList (1 .. #extendedIdentity) -- matrix representation - assert(toMatrix trimmedIdentity == id_(ZZ^1)) - assert(toMatrix extendedIdentity == id_(ZZ^(#extendedIdentity))) + assert(matrix trimmedIdentity == id_(ZZ^1)) + assert(matrix extendedIdentity == id_(ZZ^(#extendedIdentity))) /// TEST /// @@ -110,11 +110,11 @@ TEST /// assert(extendedIdentity * toList(1 .. #extendedIdentity+2) == toList(1 .. #extendedIdentity+2)) assert(extendedIdentity * switch(0, 1, toList(1 .. #extendedIdentity+2)) == switch(0, 1, toList(1 .. #extendedIdentity+2))) - assert(trimmedIdentity * (toMatrix trimmedIdentity) == toMatrix trimmedIdentity) - assert(trimmedIdentity * (toMatrix extend(trimmedIdentity, 3)) == toMatrix extend(trimmedIdentity, 3)) - assert(trimmedIdentity * (toMatrix permutation {3,1,2}) == toMatrix permutation {3,1,2}) - assert(extendedIdentity * (toMatrix extend(extendedIdentity, #extendedIdentity+2)) == toMatrix extend(extendedIdentity, #extendedIdentity+2)) - assert(extendedIdentity * (toMatrix permutation switch(0, 1, toList(1 .. #extendedIdentity+2))) == toMatrix permutation switch(0, 1, toList(1 .. #extendedIdentity+2))) + assert(trimmedIdentity * (matrix trimmedIdentity) == matrix trimmedIdentity) + assert(trimmedIdentity * (matrix extend(trimmedIdentity, 3)) == matrix extend(trimmedIdentity, 3)) + assert(trimmedIdentity * (matrix permutation {3,1,2}) == matrix permutation {3,1,2}) + assert(extendedIdentity * (matrix extend(extendedIdentity, #extendedIdentity+2)) == matrix extend(extendedIdentity, #extendedIdentity+2)) + assert(extendedIdentity * (matrix permutation switch(0, 1, toList(1 .. #extendedIdentity+2))) == matrix permutation switch(0, 1, toList(1 .. #extendedIdentity+2))) /// TEST /// @@ -286,7 +286,7 @@ TEST /// -- matrix representation antiDiagIdentity = matrix for i in (0 ..< #p) list for j in (0 ..< #p) list if i+j == #p-1 then 1 else 0 - assert(toMatrix p == antiDiagIdentity) + assert(matrix p == antiDiagIdentity) /// TEST /// @@ -301,9 +301,11 @@ TEST /// assert(p * toList(1 .. #p) == pList) assert(p * toList(1 .. #p+2) == toList extendedP) assert(p * {5,4,3,2,1,10,9,8,7,6} == {6,7,8,9,10,1,2,3,4,5}) + assert(p * (5,4,3,2,1,10,9,8,7,6) == {6,7,8,9,10,1,2,3,4,5}) + assert(p * [5,4,3,2,1,10,9,8,7,6] == {6,7,8,9,10,1,2,3,4,5}) - assert(p * (toMatrix p) == id_(ZZ^#p)) - assert(p * (toMatrix permutation {6,7,8,9,10,1,2,3,4,5}) == matrix {{0,0,0,0,1,0,0,0,0,0}, + assert(p * (matrix p) == id_(ZZ^#p)) + assert(p * (matrix permutation {6,7,8,9,10,1,2,3,4,5}) == matrix {{0,0,0,0,1,0,0,0,0,0}, {0,0,0,1,0,0,0,0,0,0}, {0,0,1,0,0,0,0,0,0,0}, {0,1,0,0,0,0,0,0,0,0}, From 95dce9691fcb8e026cf2b078f7ddb9ffe180cf40 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 28 Oct 2024 15:33:19 -0400 Subject: [PATCH 146/226] Bump Visualize to version 1.6 [ci skip] --- M2/Macaulay2/packages/Visualize.m2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/Visualize.m2 b/M2/Macaulay2/packages/Visualize.m2 index 16210fd6b4c..38ac5f9e1f7 100644 --- a/M2/Macaulay2/packages/Visualize.m2 +++ b/M2/Macaulay2/packages/Visualize.m2 @@ -18,8 +18,8 @@ newPackage( "Visualize", - Version => "1.5", - Date => "May 24, 2019", + Version => "1.6", + Date => "October 28, 2024", Authors => { {Name => "Brett Barwick", Email => "bbarwick@uscupstate.edu", HomePage => "http://faculty.uscupstate.edu/bbarwick/"}, {Name => "Thomas Enkosky", Email => "tomenk@bu.edu", HomePage => "http://math.bu.edu/people/tomenk/"}, From 9ce3790b4b9d27bcbc2d11a1ae1a91ba8799ac2b Mon Sep 17 00:00:00 2001 From: pzinn Date: Mon, 23 Sep 2024 13:49:11 +1000 Subject: [PATCH 147/226] LieTypes update --- M2/Macaulay2/packages/LieTypes.m2 | 130 +++++++++++++++++++++++------- 1 file changed, 101 insertions(+), 29 deletions(-) diff --git a/M2/Macaulay2/packages/LieTypes.m2 b/M2/Macaulay2/packages/LieTypes.m2 index b4fd9743ff4..eda763b688c 100644 --- a/M2/Macaulay2/packages/LieTypes.m2 +++ b/M2/Macaulay2/packages/LieTypes.m2 @@ -2,8 +2,8 @@ -- licensed under GPL v2 or any later version newPackage( "LieTypes", - Version => "0.81", - Date => "Jan 22, 2023", + Version => "0.82", + Date => "Sep 23, 2024", Headline => "common types and methods for Lie groups and Lie algebras", Authors => { {Name => "Dave Swinarski", Email => "dswinarski@fordham.edu"}, @@ -62,6 +62,7 @@ export { "LieAlgebraModuleFromWeights", "trivialModule", "adjointModule", + "zeroModule", "isIrreducible", "character", "adams", @@ -90,7 +91,7 @@ simpleLieAlgebra dualCoxeterNumber highestRoot simpleRoots -simpleCoroots +positiveCoroots positiveRoots starInvolution killingForm @@ -172,6 +173,7 @@ global variable names instead of the hash table contents. * define a Lie algebra based on its Cartan matrix * M @ M' for tensor product of modules over different Lie algebras * improved caching of characters +* added/exported method zeroModule *- @@ -426,6 +428,12 @@ new LieAlgebraModule from Sequence := (T,s) -> new LieAlgebraModule from { LieAlgebraModule_ZZ := (M,i) -> irreducibleLieAlgebraModule(M#"LieAlgebra",(sort keys M#"DecompositionIntoIrreducibles")#i) LieAlgebraModule_* := M -> apply(sort keys M#"DecompositionIntoIrreducibles", v -> irreducibleLieAlgebraModule(M#"LieAlgebra",v)) +LieAlgebraModule_List := (V,w) -> (V#"DecompositionIntoIrreducibles")_w +LieAlgebraModule_Vector := (V,w) -> V_(entries w) +LieAlgebraModule_LieAlgebraModule := (V,W) -> ( + if not isIrreducible W then error "last module must be irreducible"; + V_(first keys W#"DecompositionIntoIrreducibles") + ) isIrreducible = method() isIrreducible LieAlgebraModule := M -> values M#"DecompositionIntoIrreducibles" == {1} @@ -450,6 +458,10 @@ LieAlgebraModule#AfterPrint = M -> ( trivialModule = method(TypicalValue => LieAlgebraModule) trivialModule LieAlgebra := g -> irreducibleLieAlgebraModule(toList(rank g:0),g) +zeroModule = method(TypicalValue => LieAlgebraModule) +zeroModule LieAlgebra := g -> new LieAlgebraModule from (g,{}) + + LieAlgebraModule ^** ZZ := (cacheValue'(0,symbol ^**)) ((M,n) -> ( if n<0 then "error nonnegative powers only"; if n==0 then trivialModule M#"LieAlgebra" @@ -457,6 +469,13 @@ LieAlgebraModule ^** ZZ := (cacheValue'(0,symbol ^**)) ((M,n) -> ( else M**(M^**(n-1)) -- order matters for speed purposes )) +-* +-- the implementation below seems more reasonable but it's actually slower in most circumstances +LieAlgebraModule ^** ZZ := LieAlgebraModule => (M, n) -> BinaryPowerMethod(M, n, tensor, + M -> trivialModule M#"LieAlgebra", + M -> error "LieAlgebraModule ^** ZZ: expected non-negative integer") +*- + adjointWeight := (type,m) -> splice ( if type == "A" then if m==1 then {2} else {1,m-2:0,1} else if type == "B" then if m==2 then {0,2} else {0,1,m-2:0} @@ -674,7 +693,7 @@ casimirScalar(String,ZZ,List) := (type, m, w) -> ( rho:=apply(plus sequence m,h->1/1); killingForm(type,m,w,w) + 2*killingForm(type,m,w,rho) ) - +casimirScalar(LieAlgebra,List) := (g, w) -> casimirScalar(g#"RootSystemType",g#"LieAlgebraRank",w) casimirScalar(LieAlgebraModule) := (M) -> ( if not isIrreducible M then error "Casimir scalar on irreducible modules only"; g:=M#"LieAlgebra"; @@ -798,7 +817,7 @@ elemSym = memoize((L,i) -> ( else sum(subsets(L,i),product) )) characterAlgorithms#"JacobiTrudi'" = (type,m,v) -> ( -- good for high rank algebras, small weights - if type != "A" or m<=3 then return; + if type != "A" then return; z := stdVars(type,m); conj:=reverse splice apply(m,i -> v#i : i+1); if #conj == 0 then 1_(characterRing(type,m)) else det matrix table(#conj,#conj,(i,j)->elemSym(z,conj#i+j-i)) @@ -913,26 +932,31 @@ characterAlgorithms#"Freudenthal" = (type,m,v) -> ( Omega:=Freud(type,m,v); mults:=new MutableHashTable from Omega; posroots:=positiveRoots(type,m); - -- sort, removing highest weight - Omega=drop(apply(reverse sort apply(toList Omega,w->R_w),first @@ exponents),1); - scan(Omega, w -> ( - rhs:=0; - scan(posroots, a -> ( - w':=w+a; - while mults#?w' do ( - rhs=rhs+killingForm(type,m,w',a)*mults#w'; - w'=w'+a; - ))); - lhs:=killingForm(type,m,v+rho,v+rho)-killingForm(type,m,w+rho,w+rho); - mults#w = lift(2*rhs/lhs,ZZ); - )); - sum(pairs mults,(w,mu) -> mu * R_w) -- is there a nicer way of writing this? + -- sort + Omega=apply(reverse sort apply(toList Omega,w->R_w),first @@ exponents); + s:=R_v; + for i from 1 to #Omega-1 do s+=( + w:=Omega#i; + rhs:=0; + scan(posroots, a -> ( + w':=w+a; + while mults#?w' do ( + rhs=rhs+killingForm(type,m,w',a)*mults#w'; + w'=w'+a; + ))); + lhs:=killingForm(type,m,v+rho,v+rho)-killingForm(type,m,w+rho,w+rho); + mults#w = lift(2*rhs/lhs,ZZ) + )*R_w; + s ) - +characterAlgorithms#"Picker" = (type,m,v) -> ( + if type != "A" and m>4 then characterAlgorithms#"Freudenthal"(type,m,v) -- forces Freudenthal for high rank not A + else if type == "A" and m<=3 then characterAlgorithms#"Weyl"(type,m,v) -- forces Weyl for low rank A + ) -- last strategy = first choice -scan({"JacobiTrudi","Freudenthal","Weyl","JacobiTrudi'"}, strat -> addHook(symbol character,characterAlgorithms#strat,Strategy=>strat)) +scan({"JacobiTrudi","Freudenthal","Weyl","JacobiTrudi'","Picker"}, strat -> addHook(symbol character,characterAlgorithms#strat,Strategy=>strat)) character = method( Options=>{Strategy=>null}, @@ -949,7 +973,9 @@ character (String,ZZ,List) := o -> (type,m,v) -> character1(type,m,v,o) -- trick character (Sequence,Sequence,List) := o -> (type,m,v) -> character2(type,m,v,o) -- tricky to memoize a method with options character (LieAlgebra,List) := o -> (g,v) -> if rank g == 0 then 1_(characterRing g) else character(g#"RootSystemType",g#"LieAlgebraRank",v,o) -- annoying special case, otherwise wrong ring character (LieAlgebra,Vector) := o -> (g,v) -> character(g,entries v,o) -character LieAlgebraModule := o -> (cacheValue character) ((M) -> sum(pairs M#"DecompositionIntoIrreducibles",(v,a) -> a * character (M#"LieAlgebra",v,o))) +character LieAlgebraModule := o -> (cacheValue character) ((M) -> + if #(M#"DecompositionIntoIrreducibles") == 0 then 0_(characterRing M#"LieAlgebra") + else sum(pairs M#"DecompositionIntoIrreducibles",(v,a) -> a * character (M#"LieAlgebra",v,o))) weightDiagram = method( Options=>{Strategy=>null}, @@ -1130,12 +1156,7 @@ LieAlgebraModule ** LieAlgebraModule := (V,W) -> ( -- cf Humpheys' intro to LA & tensorCoefficient = method( TypicalValue=>ZZ) -tensorCoefficient(LieAlgebraModule, LieAlgebraModule,LieAlgebraModule) := (U,V,W) -> ( - if not isIrreducible W then error "third module must be irreducible"; - nu:=first keys W#"DecompositionIntoIrreducibles"; - fullTensorProduct:=(U**V)#"DecompositionIntoIrreducibles"; - fullTensorProduct_nu - ) +tensorCoefficient(LieAlgebraModule, LieAlgebraModule,LieAlgebraModule) := (U,V,W) -> (U**V)_W --------------------------------------------------------- @@ -1650,7 +1671,7 @@ doc /// w:List Description Text - Let $\mathbf{g}$ be a Lie algebra. The Killing form on $\mathbf{g}$ is the symmetric bilinear form given by $(x,y) = Tr(ad x ad y)$. It can restricted to a Cartan subalgebra $\mathbf{h}$ and transferred to $\mathbf{h}^*$, yielding a symmetric bilinear form on weights. One popular convention is to scale the Killing form so that $(\theta,\theta) =2$, where $\theta$ is the highest root. + Let $\mathbf{g}$ be a Lie algebra. The Killing form on $\mathbf{g}$ is the symmetric bilinear form given by $(x,y) = Tr(\mathrm{ad}_x \mathrm{ad}_y)$. It can restricted to a Cartan subalgebra $\mathbf{h}$ and transferred to $\mathbf{h}^*$, yielding a symmetric bilinear form on weights. One popular convention is to scale the Killing form so that $(\theta,\theta) =2$, where $\theta$ is the highest root. Example g=simpleLieAlgebra("A",2) @@ -2187,6 +2208,17 @@ doc /// Returns the one-dimensional module with zero highest weight. /// +doc /// + Key + zeroModule + (zeroModule,LieAlgebra) + Headline + The zero module of a Lie algebra + Description + Text + Returns the zero-dimensional module. +/// + doc /// Key adjointModule @@ -2206,6 +2238,7 @@ TEST /// g=simpleLieAlgebra("A",2); M=irreducibleLieAlgebraModule({2,1},g); assert(M ** trivialModule g === M) + assert(M ** zeroModule g === zeroModule g) assert(dim adjointModule(g++g)==2*dim adjointModule g) /// @@ -2470,6 +2503,45 @@ doc /// cartanMatrix h /// +doc /// + Key + (symbol _,LieAlgebraModule,ZZ) + (symbol _,LieAlgebraModule,List) + (symbol _,LieAlgebraModule,Vector) + (symbol _,LieAlgebraModule,LieAlgebraModule) + Headline + Pick out one irreducible submodule of a Lie algebra module + Description + Text + If a number is given, the ordering is the same as when the module is displayed: + Example + g=simpleLieAlgebra("A",2); + (adjointModule g)^**3 + oo_2 + Text + Instead one can simply use a weight or irreducible module as subscript: + Example + g=simpleLieAlgebra("A",3); + M=(adjointModule g)^**2 + describe M + M_{1,0,1} + M_(trivialModule g) +/// + +doc /// + Key + (symbol _*,LieAlgebraModule) + Headline + List irreducible submodules of a Lie algebra module + Description + Text + Gives a list of nonisomorphic irreducible submodules: + Example + g=simpleLieAlgebra("A",2); + (adjointModule g)^**3 + oo_* +/// + undocumented ( { (describe,LieAlgebra),(expression,LieAlgebra),(net,LieAlgebra),(texMath,LieAlgebra), From b7a11760795fc004bfb9b150e538823c3ec90b1f Mon Sep 17 00:00:00 2001 From: pzinn Date: Mon, 23 Sep 2024 13:50:25 +1000 Subject: [PATCH 148/226] change ordering of symbols in make-M2-symbols.m2 --- M2/Macaulay2/editors/make-M2-symbols.m2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/editors/make-M2-symbols.m2 b/M2/Macaulay2/editors/make-M2-symbols.m2 index 2f74788b1d0..53c7a4189b3 100644 --- a/M2/Macaulay2/editors/make-M2-symbols.m2 +++ b/M2/Macaulay2/editors/make-M2-symbols.m2 @@ -11,6 +11,8 @@ -- - highlight.js ------------------------------------------------------------------------------- +exportFrom_Core "sortBy" + -- TODO: Move these two elsewhere: Function and Function := (f, g) -> s -> f s and g s Function or Function := (f, g) -> s -> f s or g s @@ -36,7 +38,7 @@ okay(String, Symbol) := (name, pkg) -> length name > 1 and isAlphaNumeric name -- Get a list of all symbols visible just after loading preloaded packages allPkgNames := separate(" ", version#"packages") | {"Core"} loadedPkgNames := Core#"preloaded packages" | {"Core", "Text", "Parsing", "SimpleDoc"} -symbols := unique sort join( +symbols := unique (sortBy ascii @@ first) join( apply(allPkgNames, pkgname -> (pkgname, symbol Core)), flatten apply(loadedPkgNames, pkgname -> ( pkg := needsPackage pkgname; From c00cfedb11ce3442187b5f0afb9fb737ec3bf521 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Wed, 23 Oct 2024 17:37:18 +0200 Subject: [PATCH 149/226] added GMP include path when searching for flint headers --- M2/cmake/check-libraries.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/cmake/check-libraries.cmake b/M2/cmake/check-libraries.cmake index 9106caaae9f..c39b27247d3 100644 --- a/M2/cmake/check-libraries.cmake +++ b/M2/cmake/check-libraries.cmake @@ -331,7 +331,7 @@ else() endif() if(FLINT_FOUND) - set(CMAKE_REQUIRED_INCLUDES "${FLINT_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${FLINT_INCLUDE_DIR};${GMP_INCLUDE_DIRS}") check_include_files(flint/nmod.h HAVE_FLINT_NMOD_H) check_include_files(flint/arb.h HAVE_FLINT_ARB_H) else() From 7907fd9dce9baa89ad6dc6be29405273d4c8f0ac Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Fri, 25 Oct 2024 11:36:21 +0200 Subject: [PATCH 150/226] fixed a bug in Bertini --- M2/Macaulay2/packages/Bertini.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/Bertini.m2 b/M2/Macaulay2/packages/Bertini.m2 index 804d565e02e..aeb3a3446db 100644 --- a/M2/Macaulay2/packages/Bertini.m2 +++ b/M2/Macaulay2/packages/Bertini.m2 @@ -2115,7 +2115,7 @@ importParameterFile(String) := o ->(aString)->( if o.NameParameterFile===3 then NPF="random_values"; aString=aString|NPF; if false===fileExists aString - then error"The file "|NPF|" does not exist at "|aString|". "; + then error("The file "|NPF|" does not exist at "|aString|"."); getLines:=apply(lines get (aString),i->select("[0-9e.+-]+",i)); -- grabs all lines of the solution file and selects desired words expectedNumberOfParameters:=value (getLines_0_0); getLines=drop(getLines,2); From 3d1b055c9fe43ade6488b16907e3907cbdc9ca07 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 28 Oct 2024 02:21:48 +0100 Subject: [PATCH 151/226] added two packages to isCapturable exclusion list Closes #3458 --- M2/Macaulay2/m2/examples.m2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/m2/examples.m2 b/M2/Macaulay2/m2/examples.m2 index 4a103d6674e..c38e97eec02 100644 --- a/M2/Macaulay2/m2/examples.m2 +++ b/M2/Macaulay2/m2/examples.m2 @@ -134,7 +134,10 @@ isCapturable = (inputs, pkg, isTest) -> ( inputs = replace("-\\*.*?\\*-", "", inputs); -- TODO: remove this when the effects of capture on other packages is reviewed (isTest or match({"FirstPackage", "Macaulay2Doc"}, pkg#"pkgname")) - and not match({"MultiprojectiveVarieties", "EngineTests","ThreadedGB","RunExternalM2","SpecialFanoFourfolds"}, pkg#"pkgname") + and not match({ + "FastMinors", "TerraciniLoci", + "MultiprojectiveVarieties", "SpecialFanoFourfolds", + "EngineTests", "ThreadedGB", "RunExternalM2"}, pkg#"pkgname") and not (match({"Cremona"}, pkg#"pkgname") and version#"pointer size" == 4) -- FIXME: these are workarounds to prevent bugs, in order of priority for being fixed: and not match("(gbTrace|NAGtrace)", inputs) -- cerr/cout directly from engine isn't captured From e275ebaf2b5b4668e9a9ae7b43c1e5563a03d165 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Mon, 28 Oct 2024 02:43:31 +0100 Subject: [PATCH 152/226] removed deprecated GC macro GC_REDIRECT_TO_LOCAL Closes #965. c.f. https://github.com/ivmai/bdwgc/commit/d2a865d9e19b59f7299b9b6b109a61f60b7f3e13 --- M2/Macaulay2/e/newdelete.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/M2/Macaulay2/e/newdelete.hpp b/M2/Macaulay2/e/newdelete.hpp index d084464d74b..e27dce59809 100644 --- a/M2/Macaulay2/e/newdelete.hpp +++ b/M2/Macaulay2/e/newdelete.hpp @@ -1,8 +1,6 @@ #ifndef NEWDELETE_H #define NEWDELETE_H 1 -#define GC_REDIRECT_TO_LOCAL // enable thread-local allocation - #include "M2mem.h" // for freemem, getmem, outofmem2 #include "debug.h" // for TRAPCHK, TRAPCHK_SIZE From 6675078060a4d5dd7947105453c5e7ef2456e545 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Tue, 10 Sep 2024 11:07:54 +0200 Subject: [PATCH 153/226] fixed a broken link in IntegralClosure --- M2/Macaulay2/packages/IntegralClosure.m2 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/IntegralClosure.m2 b/M2/Macaulay2/packages/IntegralClosure.m2 index cea270fee52..b3273be7a73 100644 --- a/M2/Macaulay2/packages/IntegralClosure.m2 +++ b/M2/Macaulay2/packages/IntegralClosure.m2 @@ -1170,7 +1170,6 @@ doc /// doc /// Key - isNormal (isNormal, Ring) Headline determine if a reduced ring is normal @@ -2173,7 +2172,7 @@ document { "With this extra bit of information, the user can now compute integral closures of principal ideals in ", TT "R", " via ", TO icPIdeal, ".", - SeeAlso => {"icPIdeal", "integralClosure", "isNormal"}, + SeeAlso => {"icPIdeal", "integralClosure", (isNormal, Ring)}, Caveat => "The interface to this algorithm will likely change eventually" -- Caveat => "NOTE: mingens is not reliable, neither is kernel of the zero map!!!" } From e7172637e8d2e98d32f0295e304600213ed466fc Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Tue, 10 Sep 2024 11:17:33 +0200 Subject: [PATCH 154/226] fixed missing documentation for normalCone --- M2/Macaulay2/packages/MultiplicitySequence.m2 | 4 +-- M2/Macaulay2/packages/ReesAlgebra.m2 | 29 +++++++++++++------ 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/M2/Macaulay2/packages/MultiplicitySequence.m2 b/M2/Macaulay2/packages/MultiplicitySequence.m2 index f167df7c42d..9c1d4825b6e 100644 --- a/M2/Macaulay2/packages/MultiplicitySequence.m2 +++ b/M2/Macaulay2/packages/MultiplicitySequence.m2 @@ -373,7 +373,7 @@ doc /// this function computes the bi-graded ring Gr_m(Gr_I(R)), presented as a quotient of a bigraded polynomial ring with variables names u and v. After being computed once, this ring is stored in the cache of I. - This function is based on the method normalCone. + This function is based on the method @TO associatedGradedRing@. Example R = QQ[x,y] I = ideal"x2,xy" @@ -381,7 +381,7 @@ doc /// describe A hilbertSeries A SeeAlso - normalCone + associatedGradedRing /// doc /// diff --git a/M2/Macaulay2/packages/ReesAlgebra.m2 b/M2/Macaulay2/packages/ReesAlgebra.m2 index 79f1cbc2543..50d04bb8b62 100644 --- a/M2/Macaulay2/packages/ReesAlgebra.m2 +++ b/M2/Macaulay2/packages/ReesAlgebra.m2 @@ -1142,7 +1142,7 @@ doc /// In the following example, we find the Rees Algebra of a monomial curve singularity. We also demonstrate the use of @TO reesIdeal@, @TO symmetricKernel@, - @TO isLinearType@, @TO normalCone@, @TO associatedGradedRing@, @TO specialFiberIdeal@. + @TO isLinearType@, @TO (normalCone, Ideal, RingElement)@, @TO associatedGradedRing@, @TO specialFiberIdeal@. Example S = QQ[x_0..x_3] i = monomialCurveIdeal(S,{3,7,8}) @@ -1257,8 +1257,8 @@ doc /// doc /// Key - (normalCone, Ideal, RingElement) (normalCone, Ideal) + (normalCone, Ideal, RingElement) associatedGradedRing (associatedGradedRing, Ideal) (associatedGradedRing, Ideal, RingElement) @@ -1284,8 +1284,7 @@ doc /// isomorphic to $S/IS$, which is how it is computed here. SeeAlso reesAlgebra - associatedGradedRing - normalCone + "MultiplicitySequence::grGr" /// @@ -1928,6 +1927,8 @@ doc /// [reesIdeal, Variable] [reesAlgebra, Variable] [associatedGradedRing, Variable] + [(normalCone, Ideal), Variable] + [(normalCone, Ideal, RingElement), Variable] [specialFiberIdeal, Variable] [specialFiber, Variable] [distinguished, Variable] @@ -1986,6 +1987,8 @@ doc /// [isReduction, Strategy] [multiplicity, Strategy] [associatedGradedRing, Strategy] + [(normalCone, Ideal), Strategy] + [(normalCone, Ideal, RingElement), Strategy] [specialFiberIdeal, Strategy] [specialFiber, Strategy] [analyticSpread, Strategy] @@ -2011,7 +2014,7 @@ doc /// reesAlgebra isLinearType isReduction - normalCone + associatedGradedRing multiplicity specialFiberIdeal specialFiber @@ -2030,6 +2033,8 @@ doc /// [specialFiberIdeal, PairLimit] [multiplicity, PairLimit] [associatedGradedRing, PairLimit] + [(normalCone, Ideal), PairLimit] + [(normalCone, Ideal, RingElement), PairLimit] [isReduction, PairLimit] [isLinearType,PairLimit] [reesAlgebra,PairLimit] @@ -2048,7 +2053,7 @@ doc /// reesAlgebra isLinearType isReduction - normalCone + associatedGradedRing multiplicity specialFiberIdeal specialFiber @@ -2067,6 +2072,8 @@ doc /// [specialFiberIdeal, MinimalGenerators] [multiplicity, MinimalGenerators] [associatedGradedRing, MinimalGenerators] + [(normalCone, Ideal), MinimalGenerators] + [(normalCone, Ideal, RingElement), MinimalGenerators] [isReduction, MinimalGenerators] [isLinearType,MinimalGenerators] [reesAlgebra,MinimalGenerators] @@ -2086,7 +2093,7 @@ doc /// reesAlgebra isLinearType isReduction - normalCone + associatedGradedRing multiplicity specialFiberIdeal specialFiber @@ -2104,6 +2111,8 @@ doc /// [specialFiber, BasisElementLimit] [multiplicity, BasisElementLimit] [associatedGradedRing, BasisElementLimit] + [(normalCone, Ideal), BasisElementLimit] + [(normalCone, Ideal, RingElement), BasisElementLimit] [isReduction, BasisElementLimit] [isLinearType,BasisElementLimit] [reesAlgebra,BasisElementLimit] @@ -2123,7 +2132,7 @@ doc /// reesAlgebra isLinearType isReduction - normalCone + associatedGradedRing multiplicity specialFiberIdeal specialFiber @@ -2141,6 +2150,8 @@ doc /// [specialFiber, DegreeLimit] [multiplicity, DegreeLimit] [associatedGradedRing, DegreeLimit] + [(normalCone, Ideal), DegreeLimit] + [(normalCone, Ideal, RingElement), DegreeLimit] [isReduction, DegreeLimit] [isLinearType,DegreeLimit] [reesAlgebra,DegreeLimit] @@ -2162,7 +2173,7 @@ doc /// reesAlgebra isLinearType isReduction - normalCone + associatedGradedRing multiplicity specialFiberIdeal specialFiber From 2b223fc273ae153344d36c5db0b2eeddb06d65f9 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Tue, 10 Sep 2024 11:20:03 +0200 Subject: [PATCH 155/226] fixed broken links for isNormal --- M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 | 2 +- M2/Macaulay2/packages/Macaulay2Doc/shared.m2 | 6 +++++- M2/Macaulay2/packages/NCAlgebra/NCAlgebraDoc.m2 | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 b/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 index a9b69f0939b..e5a4e3b01f5 100644 --- a/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 +++ b/M2/Macaulay2/packages/AssociativeAlgebras/doc.m2 @@ -227,7 +227,7 @@ doc /// Text The normal elements in degree 2 are x^2, y^2 and z^2. The basis calculation shows y^2 and z^2 are normal forms in B. The normalElements - method first checks all basis monomials using @ TO isNormal @. In this case + method first checks all basis monomials using @ TO (isNormal, RingElement)@. In this case it finds y^2 and z^2 are normal and returns this information. However, x^2 is not a normal form expression. The normal form of x^2 is y*z+z*y. In the second phase of the calculation, the method returns generators of the diff --git a/M2/Macaulay2/packages/Macaulay2Doc/shared.m2 b/M2/Macaulay2/packages/Macaulay2Doc/shared.m2 index 3d777937eac..38bd36f3809 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/shared.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/shared.m2 @@ -15,7 +15,11 @@ document { Key => isVeryAmple, methodstr, SeeAlso => { "Divisor::isVeryAmple(WeilDivisor)", "Polyhedra::isVeryAmple(Polyhedron)", "PositivityToricBundles::isVeryAmple(ToricVectorBundleKlyachko)", "NormalToricVarieties::isVeryAmple(ToricDivisor)" } } -document { Key => isNormal, methodstr, SeeAlso => { "Polyhedra::isNormal(Polyhedron)","IntegralClosure::isNormal(Ring)"} } +document { Key => isNormal, methodstr, SeeAlso => { + "Polyhedra::isNormal(Polyhedron)", + "IntegralClosure::isNormal(Ring)", + "AssociativeAlgebras::isNormal(RingElement)", + } } document { Key => normalCone, methodstr, SeeAlso => { "Polyhedra::normalCone(Polyhedron,Polyhedron)","ReesAlgebra::normalCone(Ideal)"} } diff --git a/M2/Macaulay2/packages/NCAlgebra/NCAlgebraDoc.m2 b/M2/Macaulay2/packages/NCAlgebra/NCAlgebraDoc.m2 index 72081766265..8d0bedf0d88 100644 --- a/M2/Macaulay2/packages/NCAlgebra/NCAlgebraDoc.m2 +++ b/M2/Macaulay2/packages/NCAlgebra/NCAlgebraDoc.m2 @@ -2487,7 +2487,7 @@ doc /// Text The normal elements in degree 2 are x^2, y^2 and z^2. The basis calculation shows x^2 and y^2 are normal forms in B. The normalElements - method first checks all basis monomials using @ TO isNormal @. In this case + method first checks all basis monomials using @ TO (isNormal, NCRingElement)@. In this case it finds x^2 and y^2 are normal and returns this information. However, z^2 is not a normal form expression. The normal form of z^2 is x*y+y*x. In the second phase of the calculation, the method returns generators of the From 826696c13dfd1139c104d0541614236a68e40d06 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Wed, 11 Sep 2024 10:15:06 +0200 Subject: [PATCH 156/226] moved associatedGradedRing up in documentation keys --- M2/Macaulay2/packages/ReesAlgebra.m2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/ReesAlgebra.m2 b/M2/Macaulay2/packages/ReesAlgebra.m2 index 50d04bb8b62..f4f1e835410 100644 --- a/M2/Macaulay2/packages/ReesAlgebra.m2 +++ b/M2/Macaulay2/packages/ReesAlgebra.m2 @@ -1257,11 +1257,11 @@ doc /// doc /// Key - (normalCone, Ideal) - (normalCone, Ideal, RingElement) associatedGradedRing (associatedGradedRing, Ideal) (associatedGradedRing, Ideal, RingElement) + (normalCone, Ideal) + (normalCone, Ideal, RingElement) Headline The normal cone of a subscheme Usage From 2fbb7b5bac68f809531b2efbb719559819e3a3d8 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 1 Oct 2024 11:16:54 -0400 Subject: [PATCH 157/226] Add scalar division methods --- M2/Macaulay2/m2/matrix.m2 | 2 ++ M2/Macaulay2/m2/modules.m2 | 1 + 2 files changed, 3 insertions(+) diff --git a/M2/Macaulay2/m2/matrix.m2 b/M2/Macaulay2/m2/matrix.m2 index 66ec39c5a35..d748a4c47cb 100644 --- a/M2/Macaulay2/m2/matrix.m2 +++ b/M2/Macaulay2/m2/matrix.m2 @@ -85,6 +85,8 @@ Matrix * Number := Matrix * RingElement := (m,r) -> ( if ring r =!= ring m then try r = promote(r,ring m) else m = promote(m,ring r); map(target m, source m, reduce(target m, raw m * raw r))) +Matrix / Number := +Matrix / RingElement := (m,r) -> m * (1/r) toSameRing = (m,n) -> ( if ring m =!= ring n then ( diff --git a/M2/Macaulay2/m2/modules.m2 b/M2/Macaulay2/m2/modules.m2 index 6c98e9b6d09..ea5494744bf 100644 --- a/M2/Macaulay2/m2/modules.m2 +++ b/M2/Macaulay2/m2/modules.m2 @@ -132,6 +132,7 @@ lift(Vector,Number) := Vector => o -> (v,S) -> vector (lift(v#0,S)) - Vector := Vector => v -> new class v from {-v#0} Number * Vector := RingElement * Vector := Vector => (r,v) -> vector(r * v#0) Vector * Number := Vector * RingElement := Vector => (v,r) -> vector(v#0 * r) +Vector / Number := Vector / RingElement := Vector => (v,r) -> vector(v#0 / r) Vector + Vector := Vector => (v,w) -> vector(v#0+w#0) Vector - Vector := Vector => (v,w) -> vector(v#0-w#0) Vector ** Vector := Vector => (v,w) -> vector(v#0**w#0) From ec1eda24279dd2bb87243cb796ba9bddc8beadb1 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 1 Oct 2024 11:17:15 -0400 Subject: [PATCH 158/226] Document scalar division --- M2/Macaulay2/packages/Macaulay2Doc/doc.m2 | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 index d616032aa09..22dc9f0fd84 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc.m2 @@ -403,6 +403,33 @@ document { SeeAlso => { "//"} } +doc /// + Key + (symbol /, Matrix, Number) + (symbol /, Matrix, RingElement) + (symbol /, Vector, Number) + (symbol /, Vector, RingElement) + Headline + scalar division + Usage + v / c + Inputs + v:{Matrix, Vector} + c:{Number, RingElement} + Outputs + :{Matrix, Vector} + Description + Text + This operation is equivalent to right scalar multiplication by the + multiplicative inverse of @CODE "c"@, i.e., @CODE "v * (1/c)"@. + Example + R = QQ[a,b,c,d] + matrix {{d, -b}, {-c, a}} / (a * d - b * c) + Caveat + The base ring of the output will be a field containing the base ring + of @CODE "v"@. +/// + document { Key => {symbol %, (symbol %, CC, CC), From d37b3500e4d24362693dea2804f127d6c0bffe7d Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 1 Oct 2024 11:17:22 -0400 Subject: [PATCH 159/226] Add unit tests for scalar division --- M2/Macaulay2/tests/normal/vector.m2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/M2/Macaulay2/tests/normal/vector.m2 b/M2/Macaulay2/tests/normal/vector.m2 index 2ee43251d51..357954e2594 100644 --- a/M2/Macaulay2/tests/normal/vector.m2 +++ b/M2/Macaulay2/tests/normal/vector.m2 @@ -23,3 +23,7 @@ assert Equation(2 * v, vector(N, {2, 4, 6})) assert Equation(x * v, vector map(N, R^{-1}, {{x}, {2*x}, {3*x}})) assert Equation(v * 2, vector(N, {2, 4, 6})) assert Equation(v * x, vector map(N, R^{-1}, {{x}, {2*x}, {3*x}})) +assert Equation(v / 2, vector(N, {1/2, 1, 3/2})) +v = vector {x, y, z} +kk = frac R +assert Equation(v / x, vector map(kk^3, kk^{-1}, {{1}, {y/x}, {z/x}})) From 83f8e0785393baad3676094b64540a33dd4c1b25 Mon Sep 17 00:00:00 2001 From: n-m-g Date: Sun, 27 Oct 2024 21:31:47 -0300 Subject: [PATCH 160/226] Update AbstractSimplicialComplexes.m2 -- fix Lint / codespell errors fixed Lint / codespell errors. --- M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 index d467153c927..86a527745f7 100644 --- a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 +++ b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 @@ -270,7 +270,7 @@ randomSubSimplicialComplex(AbstractSimplicialComplex) := AbstractSimplicialCompl -- ambient simplicial set -ambientAbstractSimplicialComplexSize = method() -- return the size of the underyling ambient simplex +ambientAbstractSimplicialComplexSize = method() -- return the size of the underlying ambient simplex ambientAbstractSimplicialComplexSize(AbstractSimplicialComplex) := (K) -> ( max flatten(K_0) @@ -701,7 +701,7 @@ doc /// Description Text This method returns the reduced homological chain complex (i.e., there is a nonzero term in - homological degree -1 that corresponds to the empty face) that is asociated + homological degree -1 that corresponds to the empty face) that is associated to an abstract simplicial complex. The chain complex is defined over the integers. Example K = abstractSimplicialComplex({{1,2,3},{2,4,9},{1,2,3,5,7,8},{3,4}}) @@ -717,7 +717,7 @@ doc /// Description Text This method returns the (non-reduced) homological chain complex (i.e., there is no nonzero term in - homological degree -1 that corresponds to the empty face) that is asociated + homological degree -1 that corresponds to the empty face) that is associated to an abstract simplicial complex. The chain complex is defined over the integers. Example K = abstractSimplicialComplex({{1,2,3},{1,4,5},{2,4,5,7}}) From ac527badcdd653f576bd73d355e95a505f91a4b1 Mon Sep 17 00:00:00 2001 From: n-m-g Date: Tue, 29 Oct 2024 08:08:59 -0300 Subject: [PATCH 161/226] Update AbstractSimplicialComplexes.m2 Added key words --- .../packages/AbstractSimplicialComplexes.m2 | 290 +++++++++++------- 1 file changed, 179 insertions(+), 111 deletions(-) diff --git a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 index 86a527745f7..ed77cb5e7f6 100644 --- a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 +++ b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 @@ -20,13 +20,14 @@ newPackage( "AbstractSimplicialComplexes", Version => "0.1", - Date => "24 September 2024", - Headline => "AbstractSimplicialComplexes", + Date => "30 September 2024", + Headline => "Abstract Simplicial Complexes", Authors => {{ Name => "Nathan Grieve", Email => "nathan.m.grieve@gmail.com", HomePage => "https://sites.google.com/view/nathan-grieve"}}, AuxiliaryFiles => false, DebuggingMode => false, PackageImports => {"Complexes"}, - PackageExports => {"Complexes"} + PackageExports => {"Complexes"}, + Keywords => {"Simplicial complexes", "Simplicial chain complexes", "Random simplicial complexes"} ) export {"AbstractSimplicialComplex", "abstractSimplicialComplex","simplicialChainComplex", "reducedSimplicialChainComplex", "ambientAbstractSimplicialComplexSize", @@ -56,15 +57,15 @@ min Complex := K -> min spots K -------------------------------------- -------------------------- --- simplicial set +-- Abstract Simplicial Complex ------------------------- --- The idea is to make a SimplicalSet as a Type of HashTable as a means --- For working with AbstractSimplicial Complexes --- +-- The idea is to make an Abstract Simplicial Complex as a Type of HashTable as a means +-- For working with Abstract Simplicial Complexes --- -- The integer keys will output the list of i-simplicies AbstractSimplicialComplex = new Type of HashTable -AbstractSimplicialComplex.synonym = "simplicial set" +AbstractSimplicialComplex.synonym = "abstract simplicial complex" AbstractSimplicialComplex.GlobalAssignHook = globalAssignFunction AbstractSimplicialComplex.GlobalReleaseHook = globalReleaseFunction @@ -75,21 +76,10 @@ new AbstractSimplicialComplex := AbstractSimplicialComplex =>(cl) -> ( K := newClass(AbstractSimplicialComplex, new HashTable); -- sigh K) ---- It will be better to make some additional keys for this class --- ---- For instance a key ambient, which will be an integer n which specifies the "ambient n-simplex on [n]" ---- That we wish to view the SimplicalSet as being contained in --- ---- This would be slightly different than the ambient size -- i.e., the smallest simplex that contains ---- The given simplicial complex ---- But actually how this is set-up should suffice --- ---- We will also want to make a key "generators" which points to the list of generators used to define ---- We would want to make ``maps" between SimplicalSets - spots AbstractSimplicialComplex := List => ( K -> sort select(keys K, i -> class i === ZZ)) - - --- This returns the p-faces of a simplicial set +-- return the p-faces of a simplicial complex AbstractSimplicialComplex _ ZZ := AbstractSimplicialComplex => (K,p) -> ( if K#?p then K#p @@ -111,7 +101,7 @@ select(L,i-> isMaximal(i,L)) ) ---- return the facets of a simplicial set +--- return the facets of a simplicial complex facets = method() @@ -121,7 +111,9 @@ facets(AbstractSimplicialComplex) := List => K ->( ) ---- decide if two simplicial sets are equal +--- decide if two simplicial complexes are equal + +--- we could overload "==" here but it seems better not to overload too many things that are external to the package areEqual = method() @@ -129,26 +121,21 @@ areEqual(AbstractSimplicialComplex,AbstractSimplicialComplex) := Boolean => (K,L return (facets K) == (facets L) ) ---- return the dimension of a simplicial set +--- returns the dimension of a simplicial complex dimAbstractSimplicialComplex = method() dimAbstractSimplicialComplex(AbstractSimplicialComplex) := ZZ => (K) -> ( - return max apply(facets(K), i -> #i) + return (max apply(facets(K), i -> #i) - 1) ) - --- Constructors for AbstractSimplicialComplexs abstractSimplicialComplex = method() ----- We need to make a sort of ``main primitive constructor" for simplicial sets ----- We need to make a method perhaps to check if a simplicial set is a simplicial complex (i.e., to check closure under taking subsets of a face) - - -- the most basic constructor of a AbstractSimplicialComplex --- The idea is to make a simplical set starting from a list of faces. +-- The idea is to make a simplical complex starting from a list of faces. -- The list of faces need not be facets. -- The constructor returns the simplicial complex (with all of its faces) that is -- generated by this list of faces @@ -185,7 +172,7 @@ abstractSimplicialComplex(ZZ,ZZ) := AbstractSimplicialComplex => (n,r) -> ( -- --- making random simplicial sets -- +-- making random simplicial complexes -- -- make a random subset of {1,...,n} @@ -215,7 +202,7 @@ randomSubset(List) := List => (L) -> ( mySubset_(random(binomial(n,k))) ) --- a variant of this is to make a random k element subset of a given set -- +-- a variant of this is would be to make a random k element subset of a given set -- -- The following will make a "random" simplicial complex on {1,...,n} -- @@ -229,7 +216,7 @@ randomAbstractSimplicialComplex(ZZ) := AbstractSimplicialComplex => (n) -> ( ------ --- it likely would also be good to make a randomSimplicial complex +-- It also seems like a good idea to make a random simplicial complex -- on [n] with dimension at most equal to r ----- @@ -243,11 +230,10 @@ randomAbstractSimplicialComplex(ZZ,ZZ) := AbstractSimplicialComplex =>(n,r) -> ( -- can we make the random complex Y_d(n,m) which has vertex set -- [n] and complete (d − 1)-skeleton, and has exactly m d-dimensional faces, --- chosen at random from all binomial(binomial(n,d+1),m) possibilities. +-- chosen at random from all binomial(binomial(n,d+1),m) possibilities? -- Such random complexes appear in lots of different contexts including in the article -- COHEN–LENSTRA HEURISTICS FOR TORSION IN HOMOLOGY OF RANDOM COMPLEXES -- (MATTHEW KAHLE, FRANK H. LUTZ, ANDREW NEWMAN, AND KYLE PARSONS) -- --- Some additinal testing of this is needed randomAbstractSimplicialComplex(ZZ,ZZ,ZZ) := (n,m,d) -> ( setRandomSeed(currentTime()); @@ -268,7 +254,7 @@ randomSubSimplicialComplex(AbstractSimplicialComplex) := AbstractSimplicialCompl --- --- ambient simplicial set +-- ambient simplicial complex ambientAbstractSimplicialComplexSize = method() -- return the size of the underlying ambient simplex @@ -284,25 +270,9 @@ ambientAbstractSimplicialComplex(AbstractSimplicialComplex) := AbstractSimplicia return abstractSimplicialComplex(ambientAbstractSimplicialComplexSize(K)) ) ---- --- Another method that could be added later is a script to check that a proposed "AbstractSimplicialComplex" --- is indeed a "AbstractSimplicialComplex" i.e., that the closure property on subsets is indeed satisfied --- this is something that we will postpone for the present time - ---------- - --- There are many ways to approach --- The simplical boundary map --- For X a given simplicial complex --- Perhaps the most straight forward way --- is via --- \partial_k : C_k(X) \rightarrow C_{k-1}(X) --- Here C_k(X) is the free --- \ZZ-module (or \kk-vector space) --- on the set of k+1 simplicies --- (i.e., the set of k+1 combinations --- of {1,...,n}) - +--------------------------- +--- boundary maps --- +------------------------ -- There are many ways to approach -- The simplical boundary map @@ -343,19 +313,15 @@ isDLexSeqI := (y,x) -> ( z := drop(x,{i,i}); if y == z then (sign = (-1)^i; break); -); -return sign + ); + return sign ) - -- make a constructor for making matrices -- that represented the simplicial boundary -- maps of a given simplical complex --- what follows appears to work OK --- more testing is required. - --- make a method for now to allow for additional testing +-- what follows appears to work OK which is good! simplicialMakeMatrix = method() @@ -381,7 +347,7 @@ reducedSimplicialChainComplex = method() -- return the chain complex (with contr reducedSimplicialChainComplex(AbstractSimplicialComplex) := Complex => (L) -> ( n := max spots L; - if n == -1 then (return complex hashTable {-1 => map(ZZ^0,ZZ^1,zero)}) + if n == -1 then (return complex hashTable {-1 => map(ZZ^0,ZZ^1,zero)}) else( mapsList := for i from 0 to n list (i => simplicialMakeMatrix(L#i,L#(i-1))); append(mapsList,-1 => map(ZZ^0,target(mapsList#0)#1,zero));); @@ -395,11 +361,12 @@ simplicialChainComplex(AbstractSimplicialComplex) := Complex => (L) -> return(naiveTruncation(reducedSimplicialChainComplex L, 0, infinity)) ) ---- Another method that would be of interest, +--- Another method that is of interest, -- is to give an inclusion (or more general a morphism) ----- of simplicial sets, then compute the induced chain complex morphism of SimplicialChainComplexes ---- An important special case would be to view a --- sub simplicial set of the full simplicial set (simplex) and then to compute +---- of simplicial complexes and then compute +-- the induced chain complex morphism of SimplicialChainComplexes +--- An important special case is to view a +-- sub simplicial complex of the full simplicial complex (simplex) and then to compute --- the corresponding induced inclusion morphism. --- A first step is to make an k-face inclusion map given an inclusion of simplicial sets @@ -408,26 +375,23 @@ simplicialChainComplex(AbstractSimplicialComplex) := Complex => (L) -> --- Otherwise the method produces the appropriate matrix --- That induces the corresponding inclusion map ---- This seems to work on some examples but needs to be tested more inducedKFaceSimplicialChainComplexMap = method() inducedKFaceSimplicialChainComplexMap(ZZ,AbstractSimplicialComplex,AbstractSimplicialComplex) := (k,H,L) -> ( -M := L_k; -N := H_k; -n := # M; -m := # N; -myMatrixList := for i from 0 to m-1 list ( - for j from 0 to n-1 list ( - if N#i == M#j then 1 else 0 - ) - ); -return matrix myMatrixList + M := L_k; + N := H_k; + n := # M; + m := # N; + myMatrixList := for i from 0 to m-1 list ( + for j from 0 to n-1 list ( + if N#i == M#j then 1 else 0 + ) + ); + return matrix myMatrixList ) - - --If H <= L then give the induced chain complex map for (non-reduced) simplicalChainComplexes inducedSimplicialChainComplexMap = method() @@ -436,9 +400,12 @@ inducedSimplicialChainComplexMap(AbstractSimplicialComplex,AbstractSimplicialCom ( h := simplicialChainComplex H; l := simplicialChainComplex L; - f := hashTable apply(spots h, i -> if i == -1 then i => map(ZZ^0,ZZ^0,zero) else i => inducedKFaceSimplicialChainComplexMap(i,L,H)); + if areEqual(abstractSimplicialComplex {{}},H)==true then return map(l,h,zero) + else( + f := hashTable apply(spots h, i -> if i == -1 then i => map(l_(-1),h_(-1),zero) else i => inducedKFaceSimplicialChainComplexMap(i,L,H)); return map(l,h,f); - ) + ) +) --If H <= L then give the induced chain complex map for reduced simplicalChainComplexes @@ -447,10 +414,12 @@ inducedReducedSimplicialChainComplexMap = method() inducedReducedSimplicialChainComplexMap(AbstractSimplicialComplex,AbstractSimplicialComplex) := (L,H) -> ( h := reducedSimplicialChainComplex H; l := reducedSimplicialChainComplex L; + if areEqual(abstractSimplicialComplex {{}},H)==true then return map(l,h, hashTable {-2 => map(l_(-2),h_(-2),zero), -1 => map(l_(-1),h_(-1),id_(h_(-1)))}) + else( f := hashTable apply(spots h, i -> if i == -1 then i => map(l_(-1),h_(-1),id_(h_(-1))) else i => inducedKFaceSimplicialChainComplexMap(i,L,H)); return map(l,h,f); ) - +) ----- @@ -460,16 +429,19 @@ beginDocumentation() document { Key => AbstractSimplicialComplexes, Headline => "a package for working with abstract simplicial complexes", - "In this package, by a slight abuse of termionalogy we mostly refer to abstract simplicial complexes as 'AbstractSimplicialComplexs'. By our viewpoint, `abstract simplicial complexes' have vertices -supported on the set [n] := {1,...,n}. - The aim of this package is to provide a methology for working with such objects directly. We are especially interested in homological aspects thereof; in particular -we provide methods for working with the chain complexes that are associated to each abstract simplicial complex.", + "In this package our conventions are that `abstract simplicial complexes' have vertices supported on the set [n] := {1,...,n}. + Our aim is to provide a methology for working with such objects directly. + In this regard our approach differs from that of the package + SimplicialComplexes.m2. + Here, we are especially interested in homological aspects of SimplicialComplexes and our approach is to implement such simplicial complexes as certain graded lists. + In particular, we provide methods for working with the chain complexes that are associated to each abstract simplicial complex. + We also give some functionality for producing random simplicial complexes.", SUBSECTION "An overview of this package", UL { TO "How to make abstract simplicial complexes", TO "How to make reduced and non-reduced simplicial chain complexes", - TO "How to make subsimpliical complexes and induced simplicial chain complex maps", + TO "Calculations with random simplicial complexes" }, } @@ -492,11 +464,25 @@ doc /// The simplicial complex that is generated by {1,2,3,4}, {2,3,5} and {1,5} can be constructed in the following way. Example - abstractSimplicialComplex({{1,2,3,4}, {2,3,5},{1,5}}) + K = abstractSimplicialComplex({{1,2,3,4}, {2,3,5},{1,5}}) Text The simplex on the vertex set [4] can be constructed as Example - abstractSimplicialComplex(4) + L = abstractSimplicialComplex(4) + Text + The faces and facets of such simplicial complexes can be accessed as + Example + K_(-1) + K_0 + K_1 + K_2 + facets K + L_(-1) + L_0 + L_1 + L_2 + L_3 + facets L /// @@ -509,7 +495,6 @@ doc /// Description Text Non-reduced and reduced simplicial chain complexes can be constructed in the following way. - This is illustrated in the following way. Example K = abstractSimplicialComplex({{1,2,3,4}, {2,3,5},{1,5}}) k = simplicialChainComplex K @@ -526,12 +511,14 @@ doc /// Description Text Given a subsimplicial complex there are induced simplicial chain complex maps. - can be used to make non-reduced and reduced simplicial chain complexes. This is illustrated in the following way. Example - K = randomAbstractSimplicialComplex(4) - randomSubSimplicialComplex(K) - facets(K) + K = abstractSimplicialComplex(4,3) + L = abstractSimplicialComplex(4,2) + f = inducedSimplicialChainComplexMap(K,L) + isWellDefined f + fRed = inducedReducedSimplicialChainComplexMap(K,L) + isWellDefined fRed /// doc /// @@ -542,7 +529,34 @@ doc /// Description Text In what follows we illustrate a collection of homological calculations that - can be performed on random simplicial complexes. + can be performed on random simplicial complexes. + Text + Create a random abstract simplicial complex with vertices supported on a subset of [n] = {1,...,n}. + Example + setRandomSeed(currentTime()); + K = randomAbstractSimplicialComplex(4) + prune HH simplicialChainComplex K + Text + Create a random simplicial complex on [n] with dimension at most equal to r. + Example + setRandomSeed(currentTime()); + L = randomAbstractSimplicialComplex(6,3) + prune HH simplicialChainComplex L + Text + Create the random complex Y_d(n,m) which has vertex set + [n] and complete (d − 1)-skeleton, and has exactly m dimension d faces, + chosen at random from all binomial(binomial(n,d+1),m) possibilities. + Example + setRandomSeed(currentTime()); + M = randomAbstractSimplicialComplex(6,3,2) + prune HH simplicialChainComplex M + Text + Creates a random sub-simplicial complex of a given simplicial complex. + Example + setRandomSeed(currentTime()); + K = randomAbstractSimplicialComplex(4) + J = randomSubSimplicialComplex(K) + inducedSimplicialChainComplexMap(K,J) /// @@ -559,13 +573,17 @@ doc /// Key AbstractSimplicialComplex Headline - the type of all simplicial sets + The type of all abstract simplicial complexes Description Text The type AbstractSimplicialComplex is a data type for working with abstract simplicial complexes with vertices supported on [n] = {1,...,n}. /// +doc /// + Key + (NewMethod, AbstractSimplicialComplex) +/// -- -- Functions and Commands @@ -576,10 +594,10 @@ doc /// areEqual (areEqual,AbstractSimplicialComplex,AbstractSimplicialComplex) Headline - Decide if two simplicial sets are equal + Decide if two simplicial complexes are equal Description Text - Decides if two simplicial sets are equal + Decides if two simplicial complexes are equal. Example areEqual(randomAbstractSimplicialComplex(4),randomAbstractSimplicialComplex(4)) /// @@ -589,15 +607,27 @@ doc /// randomAbstractSimplicialComplex (randomAbstractSimplicialComplex,ZZ) (randomAbstractSimplicialComplex,ZZ,ZZ) - (randomAbstractSimplicialComplex,ZZ,ZZ) + (randomAbstractSimplicialComplex,ZZ,ZZ,ZZ) Headline Create a random simplicial set Description Text - Creates a random abstract simplicial complex with vertices supported on a subset of [n] = {1,...,n} + Create a random abstract simplicial complex with vertices supported on a subset of [n] = {1,...,n}. Example setRandomSeed(currentTime()); K = randomAbstractSimplicialComplex(4) + Text + Create a random simplicial complex on [n] with dimension at most equal to r. + Example + setRandomSeed(currentTime()); + L = randomAbstractSimplicialComplex(6,3) + Text + Create the random complex Y_d(n,m) which has vertex set + [n] and complete (d − 1)-skeleton, and has exactly m d-dimensional faces, + chosen at random from all binomial(binomial(n,d+1),m) possibilities. + Example + setRandomSeed(currentTime()); + M = randomAbstractSimplicialComplex(6,3,2) SeeAlso "random" "randomSquareFreeMonomialIdeal" @@ -608,11 +638,12 @@ doc /// randomSubSimplicialComplex (randomSubSimplicialComplex,AbstractSimplicialComplex) Headline - Create a random sub-simplicial set + Create a random sub-simplicial complex Description Text - Creates a random sub-simplicial complex of a given simplicial complex + Creates a random sub-simplicial complex of a given simplicial complex. Example + setRandomSeed(currentTime()); K = randomAbstractSimplicialComplex(4) J = randomSubSimplicialComplex(K) /// @@ -623,7 +654,7 @@ doc /// ambientAbstractSimplicialComplex (ambientAbstractSimplicialComplex,AbstractSimplicialComplex) Headline - the ambient simplex + The ambient simplex Description Text If an abstract simplicial complex has vertices supported on a subset of [n] = {1,...,n}, and including n, @@ -641,7 +672,7 @@ doc /// ambientAbstractSimplicialComplexSize (ambientAbstractSimplicialComplexSize,AbstractSimplicialComplex) Headline - the ambient simplex size + The ambient simplex size Description Text If an abstract simplicial complex has vertices supported on a subset of [n] = {1,...,n], and including n, @@ -659,7 +690,7 @@ doc /// inducedSimplicialChainComplexMap (inducedSimplicialChainComplexMap,AbstractSimplicialComplex,AbstractSimplicialComplex) Headline - induced maps that arise via inclusions of abstract simplicial complexes + Induced maps that arise via inclusions of abstract simplicial complexes Description Text If an abstract simplicial complex can be regarded as a subsimplicial complex of another @@ -670,6 +701,13 @@ doc /// K = abstractSimplicialComplex({{1,2},{3}}) J = ambientAbstractSimplicialComplex(K) inducedSimplicialChainComplexMap(J,K) + L = abstractSimplicialComplex {{}} + inducedSimplicialChainComplexMap(L,L) + M = abstractSimplicialComplex {{1}} + L = abstractSimplicialComplex {{}} + inducedSimplicialChainComplexMap(M,L) + SeeAlso + "inducedReducedSimplicialChainComplexMap" /// doc /// @@ -677,7 +715,7 @@ doc /// inducedReducedSimplicialChainComplexMap (inducedReducedSimplicialChainComplexMap,AbstractSimplicialComplex,AbstractSimplicialComplex) Headline - induced maps that arise via inclusions of abstract simplicial complexes + Induced maps that arise via inclusions of abstract simplicial complexes Description Text If an abstract simplicial complex can be regarded as a subsimplicial complex of another @@ -688,6 +726,13 @@ doc /// K = abstractSimplicialComplex({{1,2},{3}}) J = ambientAbstractSimplicialComplex(K) inducedReducedSimplicialChainComplexMap(J,K) + L = abstractSimplicialComplex {{}} + inducedReducedSimplicialChainComplexMap(L,L) + M = abstractSimplicialComplex {{1}} + L = abstractSimplicialComplex {{}} + inducedReducedSimplicialChainComplexMap(M,L) + SeeAlso + "inducedSimplicialChainComplexMap" /// @@ -729,6 +774,7 @@ doc /// abstractSimplicialComplex (abstractSimplicialComplex,List) (abstractSimplicialComplex,ZZ) + (abstractSimplicialComplex,ZZ,ZZ) Headline The abstractSimplicialComplex that is determined by an abstract simplicial complex Description @@ -744,13 +790,17 @@ doc /// abstractSimplicialComplex({{1,2,3,4}}) abstractSimplicialComplex({{4,1,2,3}, {3,2,5},{1,5}}) abstractSimplicialComplex(4) + Text + The simplicial complex on [n] with r-skelton can be constructed as follows. + Example + abstractSimplicialComplex(4,2) /// doc /// Key (symbol _, AbstractSimplicialComplex, ZZ) Headline - The k faces of a simplicial set + The k faces of a simplicial complex Description Text This method returns the collection of k faces of a given AbstractSimplicialComplex. @@ -768,7 +818,7 @@ doc /// facets (facets, AbstractSimplicialComplex) Headline - The facets of a simplicial set + The facets of a simplicial complex Description Text This method returns the collection of facets of a given AbstractSimplicialComplex. @@ -808,9 +858,29 @@ doc /// /// + -* Test section *- TEST /// -* [insert short title for this test] *- --- test code and assertions here +assert( +K = abstractSimplicialComplex({{1,2},{3}}); +J = ambientAbstractSimplicialComplex(K); +isWellDefined inducedReducedSimplicialChainComplexMap(J,K) + ) +assert( +K = abstractSimplicialComplex({{1,2},{3}}); +J = ambientAbstractSimplicialComplex(K); +isWellDefined inducedSimplicialChainComplexMap(J,K) + ) +assert( +L = abstractSimplicialComplex({{}}); +isWellDefined inducedReducedSimplicialChainComplexMap(L,L) + ) +assert( +M = abstractSimplicialComplex {{1}}; +L = abstractSimplicialComplex {{}}; +isWellDefined inducedReducedSimplicialChainComplexMap(M,L) +) + -- may have as many TEST sections as needed /// @@ -827,6 +897,4 @@ installPackage("AbstractSimplicialComplexes", RemakeAllDocumentation => true) check "AbstractSimplicialComplexes" viewHelp"AbstractSimplicialComplexes" --- --- From 2eca0960d8355a1cf90c1e88c3d90cf6d3d2098e Mon Sep 17 00:00:00 2001 From: n-m-g Date: Tue, 29 Oct 2024 11:32:23 -0300 Subject: [PATCH 162/226] Update =distributed-packages Added AbstractSimplicialComplexes --- M2/Macaulay2/packages/=distributed-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/M2/Macaulay2/packages/=distributed-packages b/M2/Macaulay2/packages/=distributed-packages index 9e40f2b997f..be9a135e644 100644 --- a/M2/Macaulay2/packages/=distributed-packages +++ b/M2/Macaulay2/packages/=distributed-packages @@ -271,3 +271,4 @@ SchurVeronese VNumber TropicalToric MultigradedBGG +AbstractSimplicialComplexes From 9caa8160e219c6ae1c5f8da064b86e20be151664 Mon Sep 17 00:00:00 2001 From: n-m-g Date: Tue, 29 Oct 2024 19:22:50 -0300 Subject: [PATCH 163/226] Update AbstractSimplicialComplexes.m2 renamed "facets" to "abstractSimplicialComplexesFacets" to avoid key space naming conflicts (and to avoiding overloading facets for now). --- .../packages/AbstractSimplicialComplexes.m2 | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 index ed77cb5e7f6..252027a89e3 100644 --- a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 +++ b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 @@ -31,7 +31,7 @@ newPackage( ) export {"AbstractSimplicialComplex", "abstractSimplicialComplex","simplicialChainComplex", "reducedSimplicialChainComplex", "ambientAbstractSimplicialComplexSize", - "ambientAbstractSimplicialComplex", "facets", "randomAbstractSimplicialComplex", "randomSubSimplicialComplex", + "ambientAbstractSimplicialComplex", "abstractSimplicialComplexFacets", "randomAbstractSimplicialComplex", "randomSubSimplicialComplex", "inducedSimplicialChainComplexMap","inducedReducedSimplicialChainComplexMap","areEqual", "dimAbstractSimplicialComplex", } @@ -103,9 +103,9 @@ select(L,i-> isMaximal(i,L)) --- return the facets of a simplicial complex -facets = method() +abstractSimplicialComplexFacets = method() -facets(AbstractSimplicialComplex) := List => K ->( +abstractSimplicialComplexFacets(AbstractSimplicialComplex) := List => K ->( L := flatten(apply(spots K, i-> K_i)); return listFacets(L) ) @@ -118,7 +118,7 @@ facets(AbstractSimplicialComplex) := List => K ->( areEqual = method() areEqual(AbstractSimplicialComplex,AbstractSimplicialComplex) := Boolean => (K,L) ->( - return (facets K) == (facets L) + return (abstractSimplicialComplexFacets K) == (abstractSimplicialComplexFacets L) ) --- returns the dimension of a simplicial complex @@ -126,7 +126,7 @@ areEqual(AbstractSimplicialComplex,AbstractSimplicialComplex) := Boolean => (K,L dimAbstractSimplicialComplex = method() dimAbstractSimplicialComplex(AbstractSimplicialComplex) := ZZ => (K) -> ( - return (max apply(facets(K), i -> #i) - 1) + return (max apply(abstractSimplicialComplexFacets(K), i -> #i) - 1) ) --- Constructors for AbstractSimplicialComplexs @@ -248,7 +248,7 @@ randomSubSimplicialComplex = method() randomSubSimplicialComplex(AbstractSimplicialComplex) := AbstractSimplicialComplex => (K) -> ( setRandomSeed(currentTime()); - L := facets K; + L := abstractSimplicialComplexFacets K; abstractSimplicialComplex unique apply(L, i-> randomSubset(i)) ) @@ -256,7 +256,7 @@ randomSubSimplicialComplex(AbstractSimplicialComplex) := AbstractSimplicialCompl -- ambient simplicial complex -ambientAbstractSimplicialComplexSize = method() -- return the size of the underlying ambient simplex +ambientAbstractSimplicialComplexSize = method() -- return the size of the underyling ambient simplex ambientAbstractSimplicialComplexSize(AbstractSimplicialComplex) := (K) -> ( max flatten(K_0) @@ -476,13 +476,13 @@ doc /// K_0 K_1 K_2 - facets K + abstractSimplicialComplexFacets K L_(-1) L_0 L_1 L_2 L_3 - facets L + abstractSimplicialComplexFacets L /// @@ -746,7 +746,7 @@ doc /// Description Text This method returns the reduced homological chain complex (i.e., there is a nonzero term in - homological degree -1 that corresponds to the empty face) that is associated + homological degree -1 that corresponds to the empty face) that is asociated to an abstract simplicial complex. The chain complex is defined over the integers. Example K = abstractSimplicialComplex({{1,2,3},{2,4,9},{1,2,3,5,7,8},{3,4}}) @@ -762,7 +762,7 @@ doc /// Description Text This method returns the (non-reduced) homological chain complex (i.e., there is no nonzero term in - homological degree -1 that corresponds to the empty face) that is associated + homological degree -1 that corresponds to the empty face) that is asociated to an abstract simplicial complex. The chain complex is defined over the integers. Example K = abstractSimplicialComplex({{1,2,3},{1,4,5},{2,4,5,7}}) @@ -815,8 +815,8 @@ doc /// doc /// Key - facets - (facets, AbstractSimplicialComplex) + abstractSimplicialComplexFacets + (abstractSimplicialComplexFacets, AbstractSimplicialComplex) Headline The facets of a simplicial complex Description @@ -824,7 +824,7 @@ doc /// This method returns the collection of facets of a given AbstractSimplicialComplex. Example K = abstractSimplicialComplex(3) - facets K + abstractSimplicialComplexFacets K /// doc /// From 9be2c9d28241d9b2b81c0cbfaf62bb40b241ee9c Mon Sep 17 00:00:00 2001 From: n-m-g Date: Tue, 29 Oct 2024 19:29:04 -0300 Subject: [PATCH 164/226] Update AbstractSimplicialComplexes.m2 fixed the "codespell" issue again. --- M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 index 252027a89e3..3ad975f525d 100644 --- a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 +++ b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 @@ -256,7 +256,7 @@ randomSubSimplicialComplex(AbstractSimplicialComplex) := AbstractSimplicialCompl -- ambient simplicial complex -ambientAbstractSimplicialComplexSize = method() -- return the size of the underyling ambient simplex +ambientAbstractSimplicialComplexSize = method() -- return the size of the underlying ambient simplex ambientAbstractSimplicialComplexSize(AbstractSimplicialComplex) := (K) -> ( max flatten(K_0) @@ -746,7 +746,7 @@ doc /// Description Text This method returns the reduced homological chain complex (i.e., there is a nonzero term in - homological degree -1 that corresponds to the empty face) that is asociated + homological degree -1 that corresponds to the empty face) that is associated to an abstract simplicial complex. The chain complex is defined over the integers. Example K = abstractSimplicialComplex({{1,2,3},{2,4,9},{1,2,3,5,7,8},{3,4}}) @@ -762,7 +762,7 @@ doc /// Description Text This method returns the (non-reduced) homological chain complex (i.e., there is no nonzero term in - homological degree -1 that corresponds to the empty face) that is asociated + homological degree -1 that corresponds to the empty face) that is associated to an abstract simplicial complex. The chain complex is defined over the integers. Example K = abstractSimplicialComplex({{1,2,3},{1,4,5},{2,4,5,7}}) From e502faa8270a78ec08a7d91e616812bab359c0f4 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 3 Oct 2024 07:35:25 -0400 Subject: [PATCH 165/226] Update realPart/imaginaryPart to work with all Number types Previously, just worked for the ones defined in the interpreter --- M2/Macaulay2/m2/reals.m2 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/m2/reals.m2 b/M2/Macaulay2/m2/reals.m2 index 67d905d9c81..fe97e4635bb 100644 --- a/M2/Macaulay2/m2/reals.m2 +++ b/M2/Macaulay2/m2/reals.m2 @@ -226,8 +226,16 @@ CC // RR := (x,y) -> x // y_CC; CC % RR := (x,y) -> x % y_CC; -- functions -realPart Number := realPart0 -imaginaryPart Number := imaginaryPart0 +realPart ZZ := +realPart QQ := +realPart InexactNumber := realPart0 +realPart Number := realPart0 @@ numeric + +imaginaryPart ZZ := +imaginaryPart QQ := +imaginaryPart InexactNumber := imaginaryPart0 +imaginaryPart Number := imaginaryPart0 @@ numeric + conjugate CC := z -> toCC(precision z, realPart z, - imaginaryPart z) isConstant Number := i -> true From a800b7c328eab80d75727ea58c8c4cc6076dd515 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 3 Oct 2024 07:37:40 -0400 Subject: [PATCH 166/226] Define conjugate(Conjugate) This fixes previously buggy behavior where "conjugate ii" returned ii. --- M2/Macaulay2/m2/reals.m2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/M2/Macaulay2/m2/reals.m2 b/M2/Macaulay2/m2/reals.m2 index fe97e4635bb..1712d59a632 100644 --- a/M2/Macaulay2/m2/reals.m2 +++ b/M2/Macaulay2/m2/reals.m2 @@ -237,6 +237,8 @@ imaginaryPart InexactNumber := imaginaryPart0 imaginaryPart Number := imaginaryPart0 @@ numeric conjugate CC := z -> toCC(precision z, realPart z, - imaginaryPart z) +conjugate Constant := conjugate @@ numeric + isConstant Number := i -> true round RR := round CC := round0 From cd44a4c9388090b8f9a7c242c4693540486536c4 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 3 Oct 2024 07:45:08 -0400 Subject: [PATCH 167/226] Update realPart/imaginaryPart/conjugate docs * Add new methods * Add realPart/imaginaryPart to each other's SeeAlso sections * Merge stub "conjugate" node w/ conjugate(CC) --- .../packages/Macaulay2Doc/doc_arithmetic.m2 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc_arithmetic.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc_arithmetic.m2 index 2434e4fbc19..3ef74852aa5 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc_arithmetic.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc_arithmetic.m2 @@ -35,7 +35,8 @@ document { "See also ", TO "odd", "."} document { - Key => {realPart, (realPart,Number)}, + Key => {realPart, (realPart,Number), (realPart,QQ), (realPart,ZZ), + (realPart,InexactNumber)}, Headline => "real part", Usage => "realPart z", Inputs => {"z" => "an integer, rational, real or complex number"}, @@ -44,10 +45,11 @@ document { "realPart(3/4)", "realPart(1.5+2*ii)" }, - SeeAlso => {CC} + SeeAlso => {CC, imaginaryPart} } document { - Key => {imaginaryPart,(imaginaryPart,Number)}, + Key => {imaginaryPart,(imaginaryPart,Number), (imaginaryPart,QQ), + (imaginaryPart,ZZ), (imaginaryPart,InexactNumber)}, Headline => "imaginary part", Usage => "imaginaryPart z", Inputs => {"z" => "an integer, rational, real or complex number"}, @@ -56,15 +58,11 @@ document { "imaginaryPart(3/4)", "imaginaryPart(1.5+2*ii)" }, - SeeAlso => {CC} + SeeAlso => {CC, realPart} } document { - Key => conjugate, - Headline => "complex conjugate", - TT "conjugate z", " -- the complex conjugate of the complex number z."} -document { - Key => {(conjugate,CC),(conjugate,Number)}, + Key => {conjugate,(conjugate,CC),(conjugate,Number),(conjugate,Constant)}, Headline => "complex conjugate", Usage => "conjugate z", Inputs => {"z"}, From 056e27452477c1607fbcda6e1547bd04b2a72868 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 3 Oct 2024 07:48:28 -0400 Subject: [PATCH 168/226] Add unit tests for realPart/imaginaryPart/conjugate updates --- M2/Macaulay2/tests/normal/numbers.m2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/M2/Macaulay2/tests/normal/numbers.m2 b/M2/Macaulay2/tests/normal/numbers.m2 index 935e27a1f9b..93a67cea044 100644 --- a/M2/Macaulay2/tests/normal/numbers.m2 +++ b/M2/Macaulay2/tests/normal/numbers.m2 @@ -79,6 +79,9 @@ assert( hash (1p111*ii) =!= hash (1p110*ii) ) assert( hash (1p111*ii) === hash (1p111*ii) ) assert( realPart toCC 1. === 1. ) assert( imaginaryPart toCC 1. === 0. ) +assert( realPart ii === 0. ) +assert( imaginaryPart ii === 1. ) +assert( conjugate ii == -ii ) assert try (lift(1.3,ZZ); false) else true assert not liftable(1.3,ZZ) From 0de8aff1e313edc4615fd1d107b8e3c82382b86c Mon Sep 17 00:00:00 2001 From: pzinn Date: Wed, 18 Sep 2024 11:22:00 +1000 Subject: [PATCH 169/226] implement isPromotable --- M2/Macaulay2/m2/enginering.m2 | 35 +++++++++++++++++++---------------- M2/Macaulay2/m2/ringmap.m2 | 2 +- M2/Macaulay2/m2/rings.m2 | 1 + 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/M2/Macaulay2/m2/enginering.m2 b/M2/Macaulay2/m2/enginering.m2 index 62133d97f25..befeee8072f 100644 --- a/M2/Macaulay2/m2/enginering.m2 +++ b/M2/Macaulay2/m2/enginering.m2 @@ -329,6 +329,9 @@ frac EngineRing := R -> if isField R then R else if R.?frac then R.frac else ( if R.?indexSymbols then F.indexSymbols = applyValues(R.indexSymbols, r -> promote(r,F)); if R.?indexStrings then F.indexStrings = applyValues(R.indexStrings, r -> promote(r,F)); if R.?numallvars then F.numallvars=R.numallvars; + scan(R.baseRings, S -> if S.?frac and not isPromotable(S.frac,F) then + promote(S.frac,F) := (a,F) -> fraction(promote(numerator a,R),promote(denominator a,R)) + ); F) -- methods for all ring elements @@ -474,10 +477,10 @@ quotientRemainder(RingElement,RingElement) := (f,g) -> ( S := ring g; m := quotientRemainder(R,S) := ( if R === S then divmod R - else if isMember(R,S.baseRings) then ( + else if isPromotable(R,S) then ( (x,y) -> divmod(promote(x,S), y) ) - else if isMember(S,R.baseRings) then ( + else if isPromotable(S,R) then ( (x,y) -> divmod(x, promote(y,R)) ) else error "expected pair to have a method for quotientRemainder" @@ -500,10 +503,10 @@ RingElement % RingElement := RingElement => (f,g) -> ( if R === S then ( (x,y) -> new R from raw x % raw y ) - else if isMember(R,S.baseRings) then ( + else if isPromotable(R,S) then ( (x,y) -> promote(x,S) % y ) - else if isMember(S,R.baseRings) then ( + else if isPromotable(S,R) then ( (x,y) -> x % promote(y,R) ) else error "expected pair to have a method for '%'" @@ -523,10 +526,10 @@ RingElement // RingElement := RingElement => (f,g) -> ( if R === S then ( (x,y) -> new R from raw x // raw y ) - else if isMember(R,S.baseRings) then ( + else if isPromotable(R,S) then ( (x,y) -> promote(x,S) // y ) - else if isMember(S,R.baseRings) then ( + else if isPromotable(S,R) then ( (x,y) -> x // promote(y,R) ) else error "expected pair to have a method for '//'" @@ -544,10 +547,10 @@ RingElement - RingElement := RingElement => (f,g) -> ( if R === S then ( (x,y) -> new R from raw x - raw y ) - else if isMember(R,S.baseRings) then ( + else if isPromotable(R,S) then ( (x,y) -> promote(x,S) - y ) - else if isMember(S,R.baseRings) then ( + else if isPromotable(S,R) then ( (x,y) -> x - promote(y,R) ) else error "expected pair to have a method for '-'" @@ -565,10 +568,10 @@ RingElement * RingElement := RingElement => (f,g) -> ( if R === S then ( (x,y) -> new R from raw x * raw y ) - else if isMember(R,S.baseRings) then ( + else if isPromotable(R,S) then ( (x,y) -> promote(x,S) * y ) - else if isMember(S,R.baseRings) then ( + else if isPromotable(S,R) then ( (x,y) -> x * promote(y,R) ) else error "expected pair to have a method for '*'" @@ -586,10 +589,10 @@ RingElement + RingElement := RingElement => (f,g) -> ( if R === S then ( (x,y) -> new R from raw x + raw y ) - else if isMember(R,S.baseRings) then ( + else if isPromotable(R,S) then ( (x,y) -> promote(x,S) + y ) - else if isMember(S,R.baseRings) then ( + else if isPromotable(S,R) then ( (x,y) -> x + promote(y,R) ) else error "expected pair to have a method for '+'" @@ -611,10 +614,10 @@ RingElement == RingElement := (f,g) -> ( if R === S then ( (x,y) -> raw x === raw y ) - else if isMember(R,S.baseRings) then ( + else if isPromotable(R,S) then ( (x,y) -> promote(x,S) == y ) - else if isMember(S,R.baseRings) then ( + else if isPromotable(S,R) then ( (x,y) -> x == promote(y,R) ) else error "expected pair to have a method for '=='" @@ -630,10 +633,10 @@ RingElement / RingElement := RingElement => (f,g) -> ( frac R; (r,s) -> fraction (r,s) ) - else if isMember(R,S.baseRings) then ( + else if isPromotable(R,S) then ( (x,y) -> promote(x,S) / y ) - else if isMember(S,R.baseRings) then ( + else if isPromotable(S,R) then ( (x,y) -> x / promote(y,R) ) else error "expected pair to have a method for '/'" diff --git a/M2/Macaulay2/m2/ringmap.m2 b/M2/Macaulay2/m2/ringmap.m2 index c7326ff713e..65b7f94908a 100644 --- a/M2/Macaulay2/m2/ringmap.m2 +++ b/M2/Macaulay2/m2/ringmap.m2 @@ -125,7 +125,7 @@ map(Ring, Ring, Matrix) := RingMap => opts -> (R, S, m) -> ( else if r < n then error ("encountered values for ", toString r, " variables, but expected ", toString n) else if r == n then ( if numgens A > 0 then ( - if A === R or isMember(A, R.baseRings) then ( + if A === R or isPromotable(A, R) then ( -- we can promote mE = mE | promote(vars A, R); if instance(A,GaloisField) and A.rawGaloisField then ( diff --git a/M2/Macaulay2/m2/rings.m2 b/M2/Macaulay2/m2/rings.m2 index 5c79e2d6812..0df1dc49ee0 100644 --- a/M2/Macaulay2/m2/rings.m2 +++ b/M2/Macaulay2/m2/rings.m2 @@ -106,6 +106,7 @@ Number ^ Ring := lift promote = method(Dispatch => {Thing, Type, Type}) Number _ Ring := promote +isPromotable = (R,S) -> lookup(promote,R,S) =!= null -- Local Variables: -- compile-command: "make -C $M2BUILDDIR/Macaulay2/m2 " From f44cec44803eec08893c35c12a0b3bf62ed90a5b Mon Sep 17 00:00:00 2001 From: pzinn Date: Mon, 7 Oct 2024 16:51:34 +1100 Subject: [PATCH 170/226] setupPromote, setupLift, use in tensor products, selectVariables --- M2/Macaulay2/m2/enginering.m2 | 40 +++++++++++++++++-- M2/Macaulay2/m2/exports.m2 | 2 + M2/Macaulay2/m2/matrix.m2 | 6 +-- M2/Macaulay2/m2/newring.m2 | 10 ++++- M2/Macaulay2/m2/polyrings.m2 | 7 +++- M2/Macaulay2/m2/ringmap.m2 | 16 ++++++-- .../packages/CotangentSchubert/cotangent.m2 | 33 +++++---------- 7 files changed, 78 insertions(+), 36 deletions(-) diff --git a/M2/Macaulay2/m2/enginering.m2 b/M2/Macaulay2/m2/enginering.m2 index befeee8072f..d28b1d72a3b 100644 --- a/M2/Macaulay2/m2/enginering.m2 +++ b/M2/Macaulay2/m2/enginering.m2 @@ -225,7 +225,38 @@ commonEngineRingInitializations = (F) -> ( *- ) ------------------------------------------------------------------------------ +------------------------------------------------------------------------------ +-- TODO improve this, or deprecate promote/lift(List,R,S) +defaultDegMap := (R,S) -> ( + n:=degreeLength S-degreeLength R; + if n==0 then identity + else if n<0 then d -> take(d,degreeLength S) + else d -> d|toList(n:0) + ) + +-- automate promote +setupPromote = method() +setupPromote (Function,Ring,Ring,Function) := (f,R,S,degmap) -> ( + promote(R,S) := (a,S) -> f a; + promote(List,R,S) := (m,R,S) -> apply(m,degmap); + promote(Module,R,S) := (M,R1,S1) -> S ** M; + promote(Matrix,R,S) := (m,R,S) -> map(promote(target m,S),promote(source m,S),applyTable(entries m,x->promote(x,S))); + promote(MutableMatrix,R,S) := (m,R,S) -> mutableMatrix applyTable(entries m,x->promote(x,S)); + ) +setupPromote (Function,Ring,Ring) := (f,R,S) -> setupPromote(f,R,S,defaultDegMap(R,S)); + +-- automate (to some extent) lift +setupLift = method() +setupLift (Function,Ring,Ring,Function) := (f,R,S,degmap) -> ( + lift(R,S) := opts -> (a,S) -> if opts.Verify then f a else try f a; + lift(List,R,S) := opts -> (m,R,S) -> apply(m,degmap); + lift(Module,R,S) := opts -> (M,R,S) -> S ** M; + lift(Matrix,R,S) := opts -> (m,R,S) -> map(lift(target m,S),lift(source m,S),applyTable(entries m,x->lift(x,S))); + lift(MutableMatrix,R,S) := opts -> (m,R,S) -> mutableMatrix applyTable(entries m,x->lift(x,S)); + ) +setupLift (Function,Ring,Ring) := (f,R,S) -> setupLift(f,R,S,defaultDegMap(R,S)); + + ----------------------------------------------------------------------------- reduce := (r,s) -> ( z := syz( matrix{{r,s}}, SyzygyLimit => 1 ); a := z_(1,0); @@ -329,9 +360,10 @@ frac EngineRing := R -> if isField R then R else if R.?frac then R.frac else ( if R.?indexSymbols then F.indexSymbols = applyValues(R.indexSymbols, r -> promote(r,F)); if R.?indexStrings then F.indexStrings = applyValues(R.indexStrings, r -> promote(r,F)); if R.?numallvars then F.numallvars=R.numallvars; - scan(R.baseRings, S -> if S.?frac and not isPromotable(S.frac,F) then - promote(S.frac,F) := (a,F) -> fraction(promote(numerator a,R),promote(denominator a,R)) - ); + scan(R.baseRings, S -> if S.?frac and not isPromotable(S.frac,F) then ( + setupPromote(a->fraction(promote(numerator a,R),promote(denominator a,R)),S.frac,F); + setupLift(a->fraction(lift(numerator a,S),lift(denominator a,S)),F,S.frac); + )); F) -- methods for all ring elements diff --git a/M2/Macaulay2/m2/exports.m2 b/M2/Macaulay2/m2/exports.m2 index 2d9febd66ec..c77d7ee82e6 100644 --- a/M2/Macaulay2/m2/exports.m2 +++ b/M2/Macaulay2/m2/exports.m2 @@ -1127,6 +1127,8 @@ export { "setRandomSeed", "setup", "setupEmacs", + "setupLift", + "setupPromote", "shield", "show", "showClassStructure", diff --git a/M2/Macaulay2/m2/matrix.m2 b/M2/Macaulay2/m2/matrix.m2 index d748a4c47cb..d05db79a718 100644 --- a/M2/Macaulay2/m2/matrix.m2 +++ b/M2/Macaulay2/m2/matrix.m2 @@ -168,9 +168,9 @@ Matrix * Matrix := Matrix => (m,n) -> ( else ( R := ring m; S := ring target n; - if R =!= S then ( - try m = m ** S else - try n = n ** R else + if R =!= S then ( -- use toSameRing? + try m = promote(m,S) else + try n = promote(n,R) else error "maps over incompatible rings"; ); M = target m; diff --git a/M2/Macaulay2/m2/newring.m2 b/M2/Macaulay2/m2/newring.m2 index af59bf8b464..c8efc8a7af9 100644 --- a/M2/Macaulay2/m2/newring.m2 +++ b/M2/Macaulay2/m2/newring.m2 @@ -77,7 +77,15 @@ 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) + RS := 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 ( + setupPromote map(RS,S,(vars AB)_{m .. m+n-1}); + setupLift map(S,RS,toList(m:0) | generators B); + ); + RS + ) ------------------------- -- Graph of a ring map -- diff --git a/M2/Macaulay2/m2/polyrings.m2 b/M2/Macaulay2/m2/polyrings.m2 index 7b882739871..59a1b5df1cc 100644 --- a/M2/Macaulay2/m2/polyrings.m2 +++ b/M2/Macaulay2/m2/polyrings.m2 @@ -274,7 +274,12 @@ selectVariables(List,PolynomialRing) := (v,R) -> ( o.Variables = o.Variables_v; o.Degrees = o.Degrees_v; o = new OptionTable from o; - (S := (coefficientRing R)(monoid [o]),map(R,S,(generators R)_v))) + S := (coefficientRing R)(monoid [o]); + f := map(R,S,(generators R)_v); + g := map(S,R,apply(generators R, v->substitute(v,S))); + setupPromote f; + setupLift g; + (S,f)) ----------------------------------------------------------------------------- diff --git a/M2/Macaulay2/m2/ringmap.m2 b/M2/Macaulay2/m2/ringmap.m2 index 65b7f94908a..c1f29e64a96 100644 --- a/M2/Macaulay2/m2/ringmap.m2 +++ b/M2/Macaulay2/m2/ringmap.m2 @@ -14,8 +14,6 @@ needs "mutablemat.m2" -- should do something about the degree map here degmap0 := n -> ( d := toList ( n : 0 ); e -> d ) -workable = f -> try (f(); true) else false - ----------------------------------------------------------------------------- -- RingMap type declarations and basic methods ----------------------------------------------------------------------------- @@ -85,7 +83,7 @@ map(Ring, Ring, Matrix) := RingMap => opts -> (R, S, m) -> ( " into a degree of length ", toString degreeLength R); opts.DegreeMap ) - else if workable (() -> promote({},S,R)) then (d -> first promote({d},S,R)) + else if (pr:=lookup(promote,List,S,R)) =!= null then (d -> first pr({d},S,R)) else if degreeLength R === degreeLength S then identity else if degreeLength S === 0 or degreeLength R === 0 then degmap0 degreeLength R else ( @@ -569,6 +567,18 @@ map(Module,Module,RingMap,List) := Matrix => o -> (M,N,p,f) -> map(M,N,p,map(M,r map(Module,Nothing,RingMap,List) := Matrix => o -> (M,N,p,f) -> map(M,N,p,map(M,,f),o) map(Module,RingMap) := Matrix => o -> (M,p) -> map(M,,p,map(M,cover M,1),o) +-- +setupPromote (RingMap,Ring,Ring,Function) := lookup(setupPromote,Function,Ring,Ring,Function) +setupPromote (RingMap,Ring,Ring) := (f,R,S) -> setupPromote(f,R,S,f.cache.DegreeMap) +-- note that promote(Module,R,S) := (M,R,S) -> f ** M would make more sense, but promote only works with free modules anyway +setupPromote RingMap := f -> setupPromote(f,source f,target f) +setupPromote (Ring,Ring) := (R,S) -> setupPromote map(S,R) + +setupLift (RingMap,Ring,Ring) := (f,R,S) -> -- f is a partial inverse to the promote map + setupLift( a -> ( b := f a; if promote(b,R) == a then b else error "cannot lift" ), R,S,f.cache.DegreeMap); + +setupLift RingMap := f -> setupLift(f,source f,target f) + -- Local Variables: -- compile-command: "make -C $M2BUILDDIR/Macaulay2/m2 " -- End: diff --git a/M2/Macaulay2/packages/CotangentSchubert/cotangent.m2 b/M2/Macaulay2/packages/CotangentSchubert/cotangent.m2 index 7de27ab1719..8efe5ed1c4e 100644 --- a/M2/Macaulay2/packages/CotangentSchubert/cotangent.m2 +++ b/M2/Macaulay2/packages/CotangentSchubert/cotangent.m2 @@ -61,18 +61,6 @@ expandElem := (P,vrs,els) -> ( sub(C,ring first els) * product(#vrs, i -> (els#i)^(ee#i)) + expandElem(Q,vrs,els) ) --- automate promotion -promoteFromMap = method() -promoteFromMap (Ring,Ring,RingMap) := (R,S,f) -> ( - promote(R,S) := (a,S1) -> f a; - promote(Matrix,R,S) := - promote(MutableMatrix,R,S) := -- doesn't work, cf https://github.com/Macaulay2/M2/issues/2192 - promote(Module,R,S) := (M,R1,S1) -> f M; --- promote(List,R,S) := (L,R1,S1) -> f\L; -- TODO put back!!!!!!!!!! - S.baseRings = prepend(R,S.baseRings); -- temporary -- until promotability test improved in enginering.m2 - ) -promoteFromMap (Ring,Ring) := (R,S) -> promoteFromMap(R,S,map(S,R)) - tautoClass = method(Dispatch=>{Thing,Thing,Type},Options=>true); -- "Chern classes" -- renamed tautoClass to avoid confusion with motivic classes zeroSection = method(Dispatch=>{Type},Options=>true) -- note the {} dualZeroSection = method(Dispatch=>{Type},Options=>true) -- note the {} @@ -114,18 +102,18 @@ pushforwardToPointFromCotangent=method(); -- pushforward to a point from K(T^*(G q := getSymbol "q"; zbar := getSymbol "zbar"; FK_-1 = frac(factor(ZZ (monoid[q,zbar,DegreeRank=>0]))); -- same as FK_1, really but diff variable name FK_0 = frac(factor(ZZ (monoid[q,DegreeRank=>0]))); -promoteFromMap(FK_0,FK_-1); +setupPromote(FK_0,FK_-1); h := getSymbol "h"; ybar := getSymbol "ybar"; FH_-1 = frac(factor(ZZ (monoid[h,ybar]))); -- same as FH_1, really but diff variable name FH_0 = frac(factor(ZZ (monoid[h]))); -promoteFromMap(FH_0,FH_-1); +setupPromote(FH_0,FH_-1); defineFK = n -> ( if not FK#?n then ( z := getSymbol "z"; -- q := getSymbol "q"; FK_n = frac(factor(ZZ (monoid[q,z_1..z_n,DegreeRank=>0,MonomialOrder=>{Weights=>{n+1:1},RevLex}]))); - promoteFromMap(FK_0,FK_n); + setupPromote(FK_0,FK_n); ); FK#n ) @@ -134,7 +122,7 @@ defineFH = n -> ( if not FH#?n then ( y := getSymbol "y"; -- h := getSymbol "h"; FH_n = frac(factor(ZZ (monoid[h,y_1..y_n,MonomialOrder=>{Weights=>{n+1:1},Weights=>{1,n:0},RevLex}]))); - promoteFromMap(FH_0,FH_n); + setupPromote(FH_0,FH_n); ); FH#n ) @@ -149,6 +137,7 @@ defineB = (FF,n,Kth,Equiv) -> ( -- TODO remove FF -if Equiv then elem(k,drop(gens FF,1)) else if Kth then binomial(n,k) else 0); BB := BB0/J; BBs#(n,Kth,Equiv) = BB; + if Equiv then setupPromote(map(BB,if Kth then FK_0 else FH_0,{FF_0})); ); BBs#(n,Kth,Equiv) ) @@ -258,7 +247,6 @@ setupCotangent = cotOpts >> curCotOpts -> dims0 -> ( ); if curCotOpts.Presentation === Borel then ( BB := defineB(FF,n,curCotOpts.Ktheory,curCotOpts.Equivariant); - if curCotOpts.Equivariant then promoteFromMap(FF0,BB,map(BB,FF0,{FF_0})); -- TODO move elsewhere x := getSymbol "x"; -- Chern classes inds := splice apply(d+1, i -> apply(1..dimdiffs#i,j->(j,i))); @@ -278,13 +266,10 @@ setupCotangent = cotOpts >> curCotOpts -> dims0 -> ( R1 := FF monoid new Array from args; f := map(BB,R1,e\inds); AA := R1 / kernel f; - if curCotOpts.Equivariant then promoteFromMap(FF0,AA,map(AA,FF0,{FF_0})); - promoteFromMap(AA,BB,f*map(R1,AA)); + if curCotOpts.Equivariant then setupPromote(map(AA,FF0,{FF_0})); + setupPromote(f*map(R1,AA)); -- reverse transformation - lift(Module,BB,AA) := opts -> (v,b,AA) -> vector apply(entries v,x->lift(x,AA)); - lift(Matrix,BB,AA) := opts -> (m,b,AA) -> matrix applyTable(entries m,x->lift(x,AA)); - lift (BB,AA) := opts -> (b,AA) -> ( - if d == n-1 then return (map(AA,BB,gens AA)) b; -- special case of full flag + setupLift( if #(unique dims) == n+1 then map(AA,BB,gens AA) else b -> ( -- special case of full flag AB := FF monoid (BB.generatorSymbols | AA.generatorSymbols); -- no using it b = sub(b,AB); -- scan(d+1,i->b=expandElem(b,toList(AB_(dims#i)..AB_(dims#(i+1)-1)),toList(AB_(n+dims#i)..AB_(n+dims#(i+1)-1)))); @@ -292,7 +277,7 @@ setupCotangent = cotOpts >> curCotOpts -> dims0 -> ( v := seq -> apply(toList seq, j -> AB_j); scan(d+1,i->b=expandElem(b,v(dims#i..dims#(i+1)-1),v(n+dims#i..n+dims#(i+1)-1))); sub(b,AA) - ); + ),BB,AA); -- tautoClass (ZZ,ZZ,AA) := { Partial => true} >> o -> (j,i,AA) -> if o.Partial then AA_(dims#i+j-1) else e (j,i); zeroSection AA := { Partial => true} >> o -> (cacheValue (zeroSection,o.Partial)) (if o.Partial then AA -> lift(zeroSection(AA,Partial=>false),AA) From f3c37d25bb4f72594143f2e66875074cb5bfdb9d Mon Sep 17 00:00:00 2001 From: pzinn Date: Mon, 7 Oct 2024 16:52:30 +1100 Subject: [PATCH 171/226] minor liftabale changes --- M2/Macaulay2/m2/quotring.m2 | 2 +- M2/Macaulay2/m2/rationals.m2 | 1 - M2/Macaulay2/m2/rings.m2 | 3 ++- M2/Macaulay2/packages/Macaulay2Doc/functions/liftable-doc.m2 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/M2/Macaulay2/m2/quotring.m2 b/M2/Macaulay2/m2/quotring.m2 index ec946cd15e6..793b78b18db 100644 --- a/M2/Macaulay2/m2/quotring.m2 +++ b/M2/Macaulay2/m2/quotring.m2 @@ -281,7 +281,7 @@ char QuotientRing := (stashValue symbol char) ((S) -> ( g := generators gb relns; if g == 0 then return char ring g; m := g_(0,0); - if liftable(m,ZZ) then lift(m,ZZ) else 0)) + lift(m,ZZ,Verify=>false) ?? 0)) singularLocus = method() singularLocus(Ring) := QuotientRing => (R) -> ( diff --git a/M2/Macaulay2/m2/rationals.m2 b/M2/Macaulay2/m2/rationals.m2 index 50b35d00b27..849b048e8ae 100644 --- a/M2/Macaulay2/m2/rationals.m2 +++ b/M2/Macaulay2/m2/rationals.m2 @@ -50,7 +50,6 @@ assert (hash ZZ < hash QQ) lift(QQ,ZZ) := opts -> (r,o) -> if denominator r === 1 then numerator r else if opts.Verify then error "rational number is not an integer" liftable(QQ,ZZ) := (r,o) -> denominator r === 1 lift(QQ,QQ) := opts -> (r,QQ) -> r -liftable(QQ,QQ) := (QQ,QQ) -> true QQ.degreeLength = 0 isUnit Number := x -> x != 0 diff --git a/M2/Macaulay2/m2/rings.m2 b/M2/Macaulay2/m2/rings.m2 index 0df1dc49ee0..61c16bf8068 100644 --- a/M2/Macaulay2/m2/rings.m2 +++ b/M2/Macaulay2/m2/rings.m2 @@ -90,12 +90,13 @@ toExternalString Ring := toString @@ describe -- promote, lift, liftable, and isConstant ----------------------------------------------------------------------------- +-- TODO rename isLiftable; currently impossible due to conflict with Varieties::isLiftable -- some remnants from lift and promote, version 2 liftable = method(TypicalValue => Boolean, Dispatch => {Thing, Type, Type}) liftable(Number, Number) := liftable(Number, RingElement) := liftable(RingElement, Number) := -liftable(RingElement, RingElement) := (f, R) -> null =!= lift(f, R, Verify => false) +liftable(RingElement, RingElement) := (f, R) -> lookup(lift,class f,R) =!= null and null =!= lift(f, R, Verify => false) isConstant = method(TypicalValue => Boolean) isConstant RingElement := r -> liftable(r, coefficientRing ring r) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/liftable-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/liftable-doc.m2 index 377db380fd3..1e8130d6896 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/liftable-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/liftable-doc.m2 @@ -6,7 +6,7 @@ undocumented {(liftable, Number, Number), (liftable, Number, RingElement), (liftable, RingElement, Number), (liftable, RingElement, RingElement), - (liftable, QQ, QQ), (liftable, QQ, ZZ), + (liftable, QQ, ZZ), (lift, Matrix, InexactNumber), (lift,Matrix,InexactNumber'),(lift, Number, InexactNumber), (liftable, Number, InexactNumber), From eed5da654b95b8c9d1aaa7f0292ed36435c34b92 Mon Sep 17 00:00:00 2001 From: pzinn Date: Mon, 7 Oct 2024 16:53:22 +1100 Subject: [PATCH 172/226] doc and tests for promote, lift update --- M2/Macaulay2/packages/Macaulay2Doc/doc5.m2 | 8 ++-- .../Macaulay2Doc/functions/lift-doc.m2 | 2 +- .../Macaulay2Doc/functions/promote-doc.m2 | 2 +- .../Macaulay2Doc/functions/setupLift-doc.m2 | 45 +++++++++++++++++++ .../functions/setupPromote-doc.m2 | 32 +++++++++++++ M2/Macaulay2/tests/normal/testpromote.m2 | 23 ++++++++++ 6 files changed, 106 insertions(+), 6 deletions(-) create mode 100644 M2/Macaulay2/packages/Macaulay2Doc/functions/setupLift-doc.m2 create mode 100644 M2/Macaulay2/packages/Macaulay2Doc/functions/setupPromote-doc.m2 diff --git a/M2/Macaulay2/packages/Macaulay2Doc/doc5.m2 b/M2/Macaulay2/packages/Macaulay2Doc/doc5.m2 index 740f0ed96eb..163de20ea29 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/doc5.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/doc5.m2 @@ -360,7 +360,7 @@ document { Key => {(eagonNorthcott,Matrix),eagonNorthcott}, document { Key => {(selectVariables,List,PolynomialRing),selectVariables}, Headline => "make a subring of a polynomial ring generated by selected variables", - Usage => "(S,f) = selectVariables(v,R)", + Usage => "(S,F) = selectVariables(v,R)", Inputs => { "v" => {"a sorted list of numbers specifying which variables to select"}, "R" @@ -369,13 +369,13 @@ document { Key => {(selectVariables,List,PolynomialRing),selectVariables}, "S" => PolynomialRing => {"a polynomial ring generated as a subring of R by the variables whose indices occur in the list v, together with the induced monomial ordering" }, - "f" => RingMap => {"the inclusion map from S to R"} + "F" => RingMap => {"the inclusion map from S to R"} }, EXAMPLE lines /// - (S,f) = selectVariables({2,4}, QQ[a..h,Weights=>1..8]); + (S,F) = selectVariables({2,4}, QQ[a..h,Weights=>1..8]); describe S options S - f + F /// } diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/lift-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/lift-doc.m2 index 31d3063f9cd..04583b2c351 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/lift-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/lift-doc.m2 @@ -122,5 +122,5 @@ document { .0001^QQ .0001_QQ ///, - SeeAlso => {baseRings,liftable,promote} + SeeAlso => {baseRings,liftable,promote,setupLift} } diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/promote-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/promote-doc.m2 index cfaa8ade0a0..a20d1ce74b9 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/promote-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/promote-doc.m2 @@ -149,5 +149,5 @@ document { an algebra over ", TO "QQ", ", then an element of ", TT "R", " is provided by attempting the evident division.", SeeAlso => {baseRings, lift, liftable, "substitution and maps between rings", - substitute, (symbol**,Matrix,Ring) } + substitute, (symbol**,Matrix,Ring), setupPromote } } diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/setupLift-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/setupLift-doc.m2 new file mode 100644 index 00000000000..6f35a6870cf --- /dev/null +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/setupLift-doc.m2 @@ -0,0 +1,45 @@ +--- status: DRAFT +--- author(s): PZJ +--- notes: + +undocumented {(setupLift,Function,Ring,Ring,Function), (setupLift,RingMap,Ring,Ring)} + +doc /// + Key + setupLift + (setupLift,Function,Ring,Ring) + (setupLift,RingMap) + Headline + set up lift from one ring to another + Usage + setupLift (f,R,S) + setupLift g + Inputs + f: Function + R: Ring + S: Ring + g: RingMap + Description + Text + There are two possible ways of implementing @TO "lift"@ using @TT "setupLift"@. In the first one, we use a function: + Example + R=QQ[x] + S=QQ[y] + setupPromote map(R,S,{x^2}) + setupLift(a->sum(listForm a, (e,c)->if odd first e then error "not liftable" else c*y^(first e//2)),R,S) + promote(y^2+2,R) + lift(oo,S) + lift(x,S,Verify=>false) + Text + In the second one, we define a ring map which is a partial inverse to the promotion map: + Example + R=QQ[x,y] + S=R[s] + setupPromote map(R,S,{x+y}) + setupLift map(S,R,{s,0}) + promote(s^3+2*s-1,R) + lift(oo,S) + lift(x,S,Verify=>false) + SeeAlso + setupPromote +/// diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/setupPromote-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/setupPromote-doc.m2 new file mode 100644 index 00000000000..82ed4bf28b6 --- /dev/null +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/setupPromote-doc.m2 @@ -0,0 +1,32 @@ +--- status: DRAFT +--- author(s): PZJ +--- notes: + +undocumented {(setupPromote,RingMap,Ring,Ring,Function), (setupPromote,Function,Ring,Ring,Function), (setupPromote,Function,Ring,Ring), (setupPromote,RingMap,Ring,Ring), (setupPromote,Ring,Ring)} + + +doc /// + Key + setupPromote + (setupPromote,RingMap) + Headline + set up promote from one ring to another + Usage + setupPromote f + Inputs + f: RingMap + Description + Text + This defines promotion from one ring to another as the application of a ring map. + After calling @TT "setupPromote"@, any operation that is given an element of the source of @TT "f"@ but + expects an element of the target of @TT "f"@ will automatically @TO "promote"@ it by applying @TT "f"@. + Example + R=QQ[x_1,x_2] + R'=QQ[e_1,e_2,Degrees=>{1,2}] + setupPromote map(R,R',{x_1+x_2,x_1*x_2}) + promote(e_1^2,R) + e_1*x_1 + e_2==x_1*x_2 + SeeAlso + setupLift +/// diff --git a/M2/Macaulay2/tests/normal/testpromote.m2 b/M2/Macaulay2/tests/normal/testpromote.m2 index fcd727de9ba..8d8b5fd821c 100644 --- a/M2/Macaulay2/tests/normal/testpromote.m2 +++ b/M2/Macaulay2/tests/normal/testpromote.m2 @@ -63,6 +63,29 @@ assert( rawLift(raw C, f) == raw C_0 ) --E = frac D --F = GF(2,5) +-- more sophisticated, m2 level, promotes +R=QQ[x]; S=R[y]; +a=promote(1/x,frac S) +assert(lift(a,frac R) == 1/x) +assert(1/x + 1/y == a + 1/y) +assert(y/x == a * y) +assert(promote((frac R)^{1,2},frac S)==(frac S)^{{1,0},{2,0}}) +T=R**QQ[z]; +assert(promote(x_R,T) == x_T) +assert(lift(x_T,R) == x_R) +assert(lift(z,R,Verify=>false) === null) + +R=QQ[x_1,x_2] +R'=QQ[e_1,e_2,Degrees=>{1,2}] +f=map(R,R',{x_1+x_2,x_1*x_2}) +setupPromote f +assert(e_2==x_1*x_2) +assert(map(R,R') === f) + +R=QQ[u]; S=QQ[v]; +setupPromote map(R,S,{u^2},DegreeMap=>i->2*i) +assert(isHomogeneous map(R,S)) +assert(promote(S^{1,2},R)==R^{2,4}) end -- Local Variables: From 7007ccbf7efd82f7aa382ebbff4580025b3c2d3d Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 09:41:09 -0700 Subject: [PATCH 173/226] adding NumericalSemigroups.m2 --- M2/Macaulay2/packages/NumericalSemigroups.m2 | 3520 ++++++++++++++++++ 1 file changed, 3520 insertions(+) create mode 100644 M2/Macaulay2/packages/NumericalSemigroups.m2 diff --git a/M2/Macaulay2/packages/NumericalSemigroups.m2 b/M2/Macaulay2/packages/NumericalSemigroups.m2 new file mode 100644 index 00000000000..c3dd1dc7f90 --- /dev/null +++ b/M2/Macaulay2/packages/NumericalSemigroups.m2 @@ -0,0 +1,3520 @@ +newPackage( + "NumericalSemigroups", + Version => "0.1", + Date => "March 12, 2024", + Headline => "Compute the Apery set and invariants of a numerical semigroup ring", + Authors => {{ Name => "David Eisenbud", Email => "de@berkeley.edu", HomePage => "eisenbud.github.io"}, + { Name => "Frank-Olaf Schreyer", Email => "schreyer@math.uni-sb.de", HomePage => "https://www.math.uni-sb.de/ag/schreyer/index.php/publications/publications-frank-olaf-schreyer"}}, + AuxiliaryFiles => false, + DebuggingMode => true, + PackageExports => {"FourierMotzkin","Normaliz", "IntegralClosure", "FastMinors", "RandomPoints"} + ) +/// +restart + +loadPackage ("NumericalSemigroups", Reload=>true) +check "NumericalSemigroups" +uninstallPackage "NumericalSemigroups" +restart +installPackage "NumericalSemigroups" + +viewHelp "NumericalSemigroups" +viewHelp Normaliz + +/// +export { + "apery", --done FOS + "aperySet", --done FOS + "semigroup", -- done FOS + "isSymmetric",-- done FOS + "mu", --done + "socle",--done last + "type", -- done + "kunzMatrix", --done FOS + "semigroupIdeal", --done + "semigroupRing", -- FOS: take a look + "aperySemigroupRing", -- done + "gaps", -- done + "isGapSequence", --done + "findSemigroups", --done + "sums", --done + "coneEquations", + "coneRays", + "facetRays", + "allSemigroups", + "def1", --done -- degrees of first order deformations, or the generic first-order deformation itself. + "weight", + "makeUnfolding", -- done + "flatteningRelations", --done + "isSmoothableSemigroup", --done + "ewt", + "effectiveWeight", -- synonym for ewt + "kunzRing",--done FOSthe semigroup ring of R mod the multiplicity element + "burchIndex", --done + "buchweitz", --done + "buchweitzCriterion", --done + "buchweitzSemigroups", --done + "findPoint", --done + "heuristicSmoothness", --done + "knownExample", --done FOS + "isARandomFiberSmooth", --done FOS + "getFlatFamily", --done FOS + "isWeierstrassSemigroup", -- done FOS +-- "estimateTruncationRatio", + "nonWeierstrassSemigroups", -- done FOS + "LabBookProtocol", --done FOS + "fractionalIdeal", --done + } + +-* Code section *- +coneEquations = method(Options => {"Inhomogeneous" => false}) +coneEquations ZZ := Matrix => o -> m -> ( + -- Forms the equations of the homogeneous or inhomogeneous + --Kunz cone for multiplicity m + --the columns are the lexicographically ordered pairs {i,j} + --such that with 1<= i<=j<=m-1 + --i+j != m. + --if o#"Inhomogeneous" == true, then the equations + --for the inhomogeneous Kunz cone are returned + cols := flatten for i from 1 to m-1 list + for j from i to m-1 list {i,j}; + cols = select(cols, p -> sum p != m); + n := #cols; + eqns := map(ZZ^(m-1), ZZ^n, (i,j) -> ( + if (sum cols_j -(i+1)) % m == 0 then -1 else if + cols_j == {i+1,i+1} then 2 else if + isMember(i+1, cols_j) and + cols_j !={i+1,i+1} then 1 else 0)); + if o#"Inhomogeneous" then + eqns || matrix{apply(n, j-> + if sum cols_j < m then 0 else -1)} else + eqns + ) + +coneEquations List := Matrix => o -> L ->( + K := kunzMatrix L; + m := 1 + numrows K; + --get the column indices of E + cols := flatten for i from 1 to m-1 list + for j from i to m-1 list {i,j}; + cols = select(cols, p -> sum p % m !=0); + --find the positions of the cone equations that are satisfied by L + pos := positions(cols, c -> K_(c_0-1, c_1-1) != 0); + coneEquations(m,o)|(-(coneEquations (m, o))_pos) + ) +/// +restart +loadPackage("NumericalSemigroups", Reload => true) +coneEquations(4, "Inhomogeneous" => true) +L = {4,9,14,7} +allSemigroups L +coneEquations(L, "Inhomogeneous" => true) +betti((allSemigroups 5)_1) +/// + +allSemigroups = method() +allSemigroups ZZ := Sequence => m -> ( + -* + Returns a Sequence of two matrices: + The rows of the first form a + Hilbert basis for the homogeneous Kunz cone + of semigroups of multiplicity m, and + a set of module generators for the inhomogeneous + Kunz cone. + *- +ineq := transpose coneEquations m; +cong:=id_(ZZ^(m-1))|(-1)*transpose matrix{toList(1..m-1)}|transpose matrix{toList(m-1:m)}; +trunc:=id_(ZZ^(m-1))|(-1)*transpose matrix{toList(m+1..2*m-1)}; +NL:={(ineq,"inequalities"),(cong, "inhom_congruences"),(trunc,"inhom_inequalities")}; +RatCone:=normaliz NL; +M:=RatCone#"gen"; +pos:=positions(toList(0..rank target M-1),i->M_(i,m-1)==0); +hilbertBasis:=M^pos_{0..m-2}; +pos=positions(toList(0..rank target M-1),i->M_(i,m-1)==1); +moduleGenerators:=M^pos_{0..m-2}; +(hilbertBasis,moduleGenerators) +) + + +allSemigroups List := Sequence => L -> ( +-* Returns a matrix whose rows form a + Hilbert basis for the face containing L + of the homogeneous Kunz cone + of semigroups of multiplicity m; and + a set of module generators for + the corresponding face of the inhomogeneous + Kunz cone. +*- +m:=min L; +ineq0 := coneEquations m; +ap:=matrix{aperySet L}; +pos:=positions(toList(0..rank source ineq0-1),i->(ap*ineq0)_(0,i)==0); +eq:=transpose ineq0_pos; +pos=positions(toList(0..rank source ineq0-1),i->(ap*ineq0)_(0,i)=!=0); +ineq:=transpose ineq0_pos; +cong:=id_(ZZ^(m-1))|(-1)*transpose matrix{toList(1..m-1)}|transpose matrix{toList(m-1:m)}; +trunc:=id_(ZZ^(m-1))|(-1)*transpose matrix{toList(m+1..2*m-1)}; +NL:={(eq, "equations"),(ineq,"inequalities"),(cong, "inhom_congruences"),(trunc,"inhom_inequalities")}; +RatCone:=normaliz NL; +M:=RatCone#"gen"; +pos=positions(toList(0..rank target M-1),i->M_(i,m-1)==0); +hilbertBasis:=M^pos_{0..m-2}; +pos=positions(toList(0..rank target M-1),i->M_(i,m-1)==1); +moduleGenerators:=M^pos_{0..m-2}; +(hilbertBasis,moduleGenerators) +) + +buchweitzCriterion = method() +buchweitzCriterion(List) := L -> ( + G:=gaps L; + 3*(#G-1)-#sums(G,G)) + +buchweitzCriterion(ZZ,List) := (m,L) -> ( + assert(#L==m-1); + buchweitzCriterion(prepend(m,L))) + +/// + +--what succeeded: + + + +restart +loadPackage("NumericalSemigroups", Reload => true) +L = {4,9,14,7} + +(B,G) = allSemigroups 4 +(BL,GL) = allSemigroups L +(B,G) =allSemigroups {4,5} +L={6,8,10,13} +mingens L +elapsedTime (H,M)=allSemigroups L +aperySet L==first entries H+first entries M +L={10,13,15,16,18}, type L +elapsedTime (H,M)=allSemigroups L +tally flatten apply(entries M,L->buchweitzCriterion (10,L)) +tally flatten apply(entries M,L->apply(entries H,h->buchweitzCriterion(10,L+h))) + + +L=buchweitz 0 +elapsedTime (H,M)=allSemigroups L +betti H, betti M +H +showNmzOptions() +elapsedTime (H,M)=allSemigroups 8; +betti H, betti M + +i14 : elapsedTime (H,M)=allSemigroups 9; +betti H, betti M +-* +m=9 +elapsedTime (H,M)=allSemigroups m; +betti H, betti M +-- 268.992 seconds elapsed + +i15 : + 0 1 0 1 +o15 = (total: 6943 8, total: 35886 8) + -1: . 8 -1: . 8 + 0: 6943 . 0: 35886 . + + +elapsedTime tally flatten apply(entries M,L->buchweitzCriterion (L)) + + -- 43.7384 seconds elapsed + +o16 = Tally{0 => 3093} + 1 => 3803 + 2 => 4864 + 3 => 5310 + 4 => 5211 + 5 => 3852 + 6 => 3575 + 7 => 2474 + 8 => 1517 + 9 => 1086 + 10 => 575 + 11 => 308 + 12 => 150 + 13 => 42 + 14 => 21 + 15 => 3 + 16 => 2 + + + +*- +elapsedTime tally flatten apply(entries M,L->buchweitzCriterion (m,L)) +tally flatten apply(entries M,L->apply(entries H,h->buchweitzCriterion (m,L+h))) + + + +elapsedTime LB=buchweitzSemigroups(13,17)|buchweitzSemigroups(14,17) +buchweitzSemigroups(15,17) +flatten apply(LB,L->buchweitzCriterion (L)) +netList apply(LB,L->((H,M)=allSemigroups L;tally flatten apply(entries H,g-> + apply(entries M,b->buchweitzCriterion(min L,b+g))))) +netList apply(LB,L->((H,M)=allSemigroups L;(L,M^{0}))) +b=toList(14..25) +netList apply(LB_{0..3},L->((H,M)=allSemigroups L; g= first entries H;apply(16,i->genus({13}|(b+i*g))))) +netList apply(LB_{0..3},L->((H,M)=allSemigroups L; g= first entries H;apply(16,i->buchweitzCriterion(13,b+i*g)))) + + +b=toList(15..27) +apply(LB_{4..5},L->((H,M)=allSemigroups L; g= first entries H;apply(16,i->buchweitzCriterion(14,b+i*g)))) + +elapsedTime LB=buchweitzSemigroups(12,18) +elapsedTime LB=buchweitzSemigroups(13,18) -- 47.2556 seconds elapsed +elapsedTime LB=buchweitzSemigroups(14,18) -- 14.8381 seconds elapsed +elapsedTime LB=buchweitzSemigroups(15,18) -- 4.35668 seconds elapsed +elapsedTime LB=buchweitzSemigroups(16,18)=={} -- 1.19864 seconds elapsed + +elapsedTime LB=buchweitzSemigroups(16,19) +netList +N=matrix apply(LB_{0},L->((H,M)=allSemigroups L; (g= first entries H//16))) +fourierMotzkin transpose N +viewHelp "fourierMotzkin" + +restart +debug loadPackage("NumericalSemigroups", Reload => true) + +/// + +facetRays=method() +facetRays(List) := L -> ( + L1:=if L_0==0 then drop(L,1) else L; + A:=apery L1; + m:=A#"multiplicity"; + halfSpaces := coneEquations m; + a:=matrix{aperySet A}; + eqpos:=positions(toList(0..rank source halfSpaces-1),i->(a*halfSpaces)_{i}==0); + linEq:=halfSpaces_eqpos; + halfFacet:=halfSpaces%linEq; + fRays:=-(fourierMotzkin(halfFacet,linEq))_0; + fRays + ) + +coneRays = method() +coneRays ZZ := Matrix => m -> -(fourierMotzkin coneEquations m)_0 + + +findSemigroups = method() +findSemigroups(ZZ,ZZ,ZZ) := (m,c,g) ->( + --list all semigroups with multiplicity m, conductor c, and precisely g gaps + if g gc+set(1..m-1)+set{c-1}); + for G in GG list ( + s := isGapSequence(toList G); + if class s === List and gcd s == 1 then( + mingens unique (s|apply(m, i->c+i))) else continue) +) + +findSemigroups (ZZ,ZZ) := (m,g) -> ( + --list all semigroups of multiplicity m with g gaps. + L := {}; + for c from m to 2*g do( +-- <<"c = "< ( + --list all semigroups with g gaps. + L := {}; + for m from 2 to g+1 do ( + for c from m to 2*g do( + if (c-1)%m !=0 then ( + ell := findSemigroups(m,c,g); + if ell !={} then L = L |ell))); + L + ) + +/// +findSemigroups(3,8,4) == {{3,5}} +findSemigroups(5,14,8) == {{5,7,9}, {5, 9, 11, 12}} +findSemigroups(5,14,8) +assert(findSemigroups(3,8,4) == {{3,5}}) +assert(findSemigroups(5,14,8) == { + {5, 7, 11}, + {5, 7, 9}, + {5, 6, 14}, + {5, 9, 11, 12}}) + +m = 12 +elapsedTime ss = findSemigroups(m,17); +for L in ss list (if #sums(2,L)> 3*17-3 then L else continue) +/// + +/// +loadPackage( "NumericalSemigroups", Reload => true) +elapsedTime ss = findSemigroups 17; +#ss +elapsedTime bss = for L in ss list ( + G = gaps L; + g = #G; + if #sums(2,G) > 2*(2*g-2)-g+1 or + #sums(3,G) > 3*(2*g-2)-g+1 or + #sums(4,G) > 4*(2*g-2)-g+1 then L else continue) + + netList apply(bss, L -> (LA = aperySet L; + m := min L; + apply(#LA, i -> (LA_i-i-1)//min L)) +) +L = {1,3} +sums(L,L) +sums(2,L) +/// + +isGapSequence = method() +isGapSequence List := List => G'-> ( + --if the complement in the integers defines a semigroup s then return s; else + --return false + G := sort G'; + c := 1+ max G; + s := select(c+1, i ->i>0 and not isMember(i, G)); + m := min s; + s = s|apply(m-1,i->c+i+1); + if G == gaps (L := mingens s) then L else false + ) + +/// +restart +debug loadPackage("NumericalSemigroups", Reload => true) +ss = for g from 3 to 16 list elapsedTime findSemigroups g; +#flatten ss +ssplus = for g from 3 to 16 list ({g}|ss_(g-3)); + +g = ssplus_1_0 +sg = drop(ssplus_1,1) +elapsedTime sse = for s in flatten ss list( + t := false; + g = #gaps s; + for n from 2 to 4 list( + if #sums(n, gaps s)>n*(2*g-2)-g+1 then t = true); + if t == true then s else continue); #sse + + for n from 2 to 4 list + #sums(n, gaps s)>(2*(n+1)-1)*(g-1) + + (2*nxzz1)-1)*(g-1) +n = 4 + +s = first oo +n = 3 +#sums(n,gaps s) +(2*n-1)*(g-1) + +weight toList(g+1..2*g+1) +gaps toList(g+1..2*g+1) + +/// + + +gaps = method() +gaps List := List => L -> ( + --list of gaps in the semigroup generated by L + A := apery L; + c := A#"conductor"; + s := A#"semigroup"; + m := min L; + select(c, i -> not isMember(i, s)) + ) + +/// +restart +loadPackage("NumericalSemigroups", Reload => true) +g = 7 +weight toList(g+1..2*g+1) +gaps toList(g+1..2*g+1) +/// + +weight = method() +weight List := L ->( + G := sort gaps L; + sum apply (#G, i -> G_i-1 - i) + ) + +sums = method() +--sums List := L -> sort unique flatten apply(L, i-> apply(L, j-> i+j)) +sums (List, List) := (L,L') -> sort unique flatten apply(L, i-> apply(L', j-> i+j)) + +sums (ZZ,List) := (n,L) ->( + L' := L; + for i from 1 to n-1 do (L' = flatten apply(L', j -> apply(L, k -> j+k))); + sort unique L') + + +apery = method() +apery List := HashTable => L -> ( + --require gcd = 1; + if gcd L != 1 then error"requires relatively prime generating set"; + A := new MutableHashTable; + --A will hold the apery set, and a few invariants of the semigroup derived along the way + m := min L; -- the multiplicity + a := 0; -- number of keys already filled in A + S := set L + set{0}; -- S will hold all the semigroup elmeents found, including 0 + + --now look for new Apery set elememts and semigroup elements until + --all the keys have been filled. + s := m; + while a < m-1 do( + s = s+1; + t := any(L, u -> isMember(s-u, S)); + if t then ( + S = S + set {s}; + s' := s % m; + if not A#?s' and not s'== 0 then ( + A#s' = s; + a = a+1) + ) + ); + + A#"multiplicity" = m; + A#"semigroup" = sort toList S; + A#"conductor" = max A#"semigroup" - m +1; + hashTable pairs A + ) + +aperySet = method() +aperySet HashTable := List => A -> ( + K := select(keys A , k-> class k === ZZ); + apply(sort K, k -> A#k) + ) +aperySet List := L -> aperySet apery L + +semigroup = method() +semigroup List := List => L -> (apery L)#"semigroup" + +--conductor = method() +conductor List := ZZ => L -> (apery L)#"conductor" + +isSymmetric = method() +isSymmetric List := Boolean => L -> ( + A := apery L; + m := A#"multiplicity"; + c := A#"conductor"; + sgrp := #A#"semigroup"; + c == 2*(sgrp - m) + ) + +mu = method() +mu List :=List => L -> ( + As := aperySet L; + m := min L; + for i from 0 to m-2 list (As_(i) - (i+1))//m + ) +mu HashTable := List => H -> ( + --H should be apery L + As := aperySet H; + m := H#"multiplicity"; + for i from 0 to m-2 list (As_(i) - (i+1))//m + ) +--genus = method() +genus List := ZZ => L -> sum mu L +--number of gaps + +positiveResidue = (p,q) -> if p<0 then p + (1+abs p//q)*q else p%q -- assumes q>0 +--needs a version where c is known. +--mingensSemigroup = method() +--mingensSemigroup List := s -> ( +mingens List := List => o-> s ->( --note that mingens, defined in the system, has options, so the o -> is necessary + s' := select (s, a -> a != 0); + g := gcd s'; + if g != 1 then s' = apply(s', a -> a//g); + m := min s'; + s' = aperySet s'; + out :={}; + for i from 1 to m-1 do + for j from 1 to m-1 do ( + a := s'_(i-1); + b := s'_(j-1); + if a<=b then continue; + if a-b >= s'_(positiveResidue(i-j-1 , m)) then out = out | {i-1} + ); + sort ({m}|toList (set s' - set(s'_out))) + ) + +/// +restart +loadPackage"NumericalSemigroups" +s = semigroup {3,7} +mingens s + +s={8, 10, 31, 129, 130} +mingens s +/// +socle = method() +socle List := List => L' -> ( + L := mingens L'; + A := apery L; + K := select(keys A , k-> class k === ZZ); + aS := apply(sort K, k -> A#k); -- the Apery set + m := A#"multiplicity"; + select(aS, a -> all(L, ell -> + not isMember(a+ell, aS))) + ) + +/// +restart +loadPackage( "NumericalSemigroups", Reload => true) +L = {1,3} +sums(L,L) +sums(3,L) +isGapSequence(G = {1, 2, 4, 7}) +G ={1, 2, 8, 11} +elapsedTime isGapSequence G +/// + + + +eMatrix = L ->( + A := apery L; + m := A#"multiplicity"; + map(ZZ^(m-1), ZZ^(m-1), (i,j) -> if i+j+2 == m then 0 else A#(i+1)+A#(j+1)-A#((i+j+2)%m)) + ) + + +kunzMatrix = method() +kunzMatrix HashTable := Matrix => A -> ( + m := A#"multiplicity"; + map(ZZ^(m-1), ZZ^(m-1), (i,j) -> ( + if i+j+2 == m then 0 else ( + a := A#(i+1)+A#(j+1)-A#((i+j+2)%m); + if a == 0 then 1 else 0) + ))) + +kunzMatrix List := Matrix => L -> kunzMatrix apery L + +type = method() +type List := ZZ => L -> #socle L + +semigroupRing = method(Options => {"BaseField" => ZZ/101, + "VariableName" => getSymbol "x", + "MinimalGenerators" => true}) + +semigroupRing List := Ring => o-> L -> ( + I := semigroupIdeal(L,o); + R := (ring I)/I; + R.cache#"sgrp" = L; + R + ) +semigroupIdeal = method(Options => {"BaseField" => ZZ/(nextPrime 10^3), + "VariableName" => getSymbol "x", + "MinimalGenerators" => true}) +semigroupIdeal List := Ideal => o -> L -> ( + --Here the variables correspond to the given semigroup generators. + if o#"MinimalGenerators" == true then L':= mingens L else L' = L; + m := min L'; + --t := #L; + x := o#"VariableName"; + kk := o#"BaseField"; + R := kk[apply(L',i-> x_(i%m)),Degrees => L']; + t := symbol t; + R1 := kk[t]; + I := trim ker map(R1, R, apply(L', i -> t^i)); + I.cache#"sgrp" = L; + I + ) + + +/// +restart +loadPackage("NumericalSemigroups", Reload => true) +LL = {{3,5},{3,4,5},{3,4}} +L={4,5} +assert all(LL, L -> transpose facetRays L * coneEquations L == 0) +LL = {{3,5},{3,4,5},{3,4}} +assert all(LL, L -> transpose coneEquations L * facetRays L == 0) +netList apply(LL,L->ideal semigroupRing(L,symbol u)) +netList apply(LL,L->ideal semigroupRing(L)) + +semigroupIdeal({3,4,5,6}, "VariableName"=> z, "BaseField" => ZZ/3, "MinimalGenerators"=>false) +ideal(z_0^5-z_1^4) == semigroupIdeal({4,5}, "VariableName"=> z, "BaseField" => ZZ/3, "MinimalGenerators"=>false) +/// +aperySemigroupRing=method() +aperySemigroupRing List := L -> ( + A:=apery L; + m:= A#"multiplicity"; + degs1 := apply(toList(1..m-1),i-> A#i); + kk:= ZZ/101; + x := symbol x; + S1:=kk[x_0..x_(m-1),Degrees=>prepend(m,degs1)]; + t:= symbol t; + T:= kk[t]; + phi :=map(T,S1,matrix {apply(m,i->t^((degree x_i)_0))}); + I1 := ker phi; + xs:=drop(sort(gens S1,y->degree y),1)|{x_0}; + S:=kk[xs, Degrees=>apply(xs,y->(degree y)_0)]; + I:=sub(I1,S); + xs2:=flatten apply(m-1,i->apply(toList(i..m-2),j->S_i*S_j)); + xs2r:=apply(xs2,yy->yy%I); + R := S/ideal(xs2-xs2r); + R.cache#"sgrp" = L; + R + ) +semigroupFromAperySet=method() +semigroupFromAperySet(List) := List => As -> ( + -- As := aperySet L; + m:=#As+1; + L:=prepend(m,As); + semigroup L) + + + + +-* +fix:we want to apply this to a basis of Hom(I/I^2, S^1/I)/Hom(Omega, S^1/I), not to the generators of +Hom(I/I^2, S/I). + +In the case L = {3,4,5} the basis has 3 elements; Hom(I/I^2, S/I) has 6 generators, isn't even 0-dimensional. +The deformation was NOT flat before factoring out (t)^2. +*- + +def1 = method(Options => {"BaseField" => ZZ/101,"JustDegs" => true})--, "BaseField"}) +def1 List := o -> L -> ( + --degrees of first-order deformations or the generic first-order deformation itself. + B := semigroupRing (L, "BaseField" => o#"BaseField"); + I := ideal B; + S := ring I; + H := Hom(module I, S^1/I); + H' := Hom(S^(-L), S^1/I); + Dmat := diff( transpose vars S, gens I); + D := map(S^(-L),module I/I^2, Dmat); + DI := map(S^(-L),module I, Dmat); + t1module := coker map(H,H',Hom(DI, id_(S^1/I))); + pt1 := prune t1module; + pmap := (pt1.cache.pruningMap)^(-1); + surj := pmap*inducedMap (t1module, H); + bt1 := basis pt1//surj; + if o#"JustDegs" == true then return (flatten sort degrees source bt1); +--Default: execution ends here. The rest can be slow, already for multiplicity 5. + + h := rank source bt1; + homs := apply(h, i-> homomorphism bt1_{i}); + degs := -(homs/degree)|(gens S/degree); + t := symbol t; + T := coefficientRing S[t_0..t_(h-1),gens S, Degrees => degs]; + Tbar := T/(ideal(t_0..t_(h-1)))^2; + II := sub(gens I, Tbar) +sum(h, i-> Tbar_i*(map(Tbar^1, , sub(matrix homs_i, Tbar)))); + ideal(Tbar**II) + --(h, betti res coker gens I, betti res coker (Tbar** II)) + ) + +t2 = method(Options => {"BaseField" => ZZ/101}) +t2 List := o -> L -> ( + B := semigroupRing (L, "BaseField" => o#"BaseField"); + I := ideal B; + S := ring I; + prune Ext^1(I, S^1/I) + ) + + +/// +restart +loadPackage ("NumericalSemigroups", Reload => true) +L = {2,3} +L = {3,4,5} +L = {5,7,11} +apery L +def1 L +B = semigroupRing L +def1 L +--Buchweitz' example +G=toList(1..12)|{19,21,24,25} +L=isGapSequence G +B = semigroupRing L +type L +S = ambient B +I = ideal B +res I +def1 L +apery L +/// + +/// +restart +debug loadPackage("NumericalSemigroups", Reload => true) +G={1,2,3,5,6} +L=isGapSequence G +gaps L +--L = {3,5} +sum L +gaps L +R = semigroupRing (L,"a") +ideal R +I = semigroupIdeal L +isHomogeneous I +betti (F= res I) +F.dd +L = {3,4,5} +--eMatrix L +kunzMatrix L +kunzMatrix{3,5} +kunzMatrix{3,5,7} +type L +apery L +L = {3,7} +L = {27,35} + +L = {7,8,9} +socle L +A = apery L +aperySet A +isSymmetric L +mu L +genus L +mingens L + +(i,j) = (1,1) +aS_(i-1)+aS_(j-1) aS_((i+j)%m-1) +(i,j) = (0,0) +A#(i+1)+A#(j+1)-A#((i+j)%m+1) + +/// + +makeUnfolding=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) + +makeUnfolding Ideal := o-> I ->( + if not degreeLength ring I == 1 or + not isHomogeneous I or + I != trim I then + error "expected N-graded homogeneous ideal + given with minimal set of generators"; +-- gbI := gb(I,ChangeMatrix =>true); +-- chMat := getChangeMatrix gbI; + S := ring I; + kk := coefficientRing S; + degs := flatten degrees source gens I; + unfoldingTerms := flatten for i from 0 to max degs-1 list (b:=basis(i,S/I); if b==0 then + continue else (entries b))_0; + unfoldingTerms2 := apply(degs,d->select(unfoldingTerms, t-> (degree t)_0 < d)); + a := symbol a; + avars := flatten apply(#degs,i->apply(#unfoldingTerms2_i,j->a_{i,j})); + adegs := flatten apply(#degs,i->apply(unfoldingTerms2_i,t->degs_i-(degree t)_0)); + A := kk[avars,Degrees=>adegs]; + avars= reverse sort(gens A,y->degree y); + adegs=apply(avars,y->(degree y)_0); + A = kk[avars,Degrees=>adegs]; + SA := kk[gens S|gens A,Degrees=>degrees S|degrees A]; + avars = apply (#degs,i->apply(#unfoldingTerms2_i,j->a_{i,j})); + unfoldingTerms3 := matrix{apply(#degs,i->sum(#unfoldingTerms2_i,j-> + sub(a_{i,j},SA)*sub((unfoldingTerms2_i)_j,SA)))}; + unfolding := sub(gens I,SA)+unfoldingTerms3; + (A,unfolding) + ) + +makeUnfolding List := o-> L -> ( + I:= trim ideal semigroupRing(L,"BaseField"=>o#"BaseField"); + makeUnfolding I) + + +-* +flatteningRelations1=method() +flatteningRelations1(Ideal,Ring, Matrix) := (I,A,unfolding) -> ( + gbI:=gb(I,ChangeMatrix=>true); + S := ring I; + SA := ring unfolding; + chMat:=getChangeMatrix gbI; + unfoldingGB := unfolding*sub(chMat,SA); + ldT := flatten entries leadTerm unfoldingGB; + s0:=syz sub(gens gbI,SA);s1:=null; + --Now we compute the Buchberger test syzygies + us:=null;testSyzygy1:=null;u1:=null; + while ( + testSyzygy1=unfoldingGB*s0; + us=apply(ldT,u->(u1=contract(u,testSyzygy1); + testSyzygy1=testSyzygy1-u*u1; + u1)); + s1=fold(us,{i,j}->i||j); + not s1 == 0 ) do ( + s0 = s0-s1); + --The flatteningRelations are the coefficients of testSyzygy2 + testSyzygy2:=unfoldingGB*s0; + ma := max flatten degrees source syz leadTerm gens gbI; + rems := reverse flatten for i from 0 to ma list (b:=basis(i,S^1/I); if b==0 then continue else (entries b))_0; + us = apply(rems,u->(u1:=contract(sub(u,SA),testSyzygy2);testSyzygy2-sub(u,SA)*u1; + u1)); + relsA:=sub(ideal(flatten us),A); + relsA + ) +*- + +flatteningRelations=method() +flatteningRelations(Ideal,Ring, Matrix) := (I,A,unfolding) -> ( + gbI:=gb(I,ChangeMatrix=>true); + S := ring I; + SA := ring unfolding; + chMat:=getChangeMatrix gbI; + unfoldingGB := unfolding*sub(chMat,SA); + -- can one use the build in gb algorithm to copute the + -- flattening relations faster + unfGBf:=forceGB unfoldingGB; + ldT := flatten entries leadTerm unfoldingGB; + s0:=syz sub(gens gbI,SA); + testSyzygy1:=unfoldingGB*s0; + testSyzygy2:=testSyzygy1%unfGBf; + u1:=null; + ma := max flatten degrees source syz leadTerm gens gbI; + rems := reverse flatten for i from 0 to ma list (b:=basis(i,S^1/I); if b==0 then continue else (entries b))_0; + us := apply(rems,u->(u1=contract(sub(u,SA),testSyzygy2);testSyzygy2-sub(u,SA)*u1; + u1)); + relsA:=sub(ideal(flatten us),A); + relsA + ) + + + + +isSmoothableSemigroup=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) + +isSmoothableSemigroup(List,RR,ZZ) := o-> (L,r,n) -> ( + (I,J1,family) := getFlatFamily(L,r,n,o); + isARandomFiberSmooth(I,J1,family,o)) + + +ewt=method() +ewt(List):= L -> ( + G:=gaps L; + L1:=mingens L; + sum(L1,a->#select(G,b->a ewt sgrp + +findPoint=method(Options => {Verbose => false}) + +findPoint(Ideal) := o -> (c) -> ( + c1 := prune c; + R := ring c; + A1 := vars R % c; + if c1==0 then return sub(A1,random(R^1,R^(numgens R))); + if o.Verbose then << "has to solve" <false),kk);) else ( + point = sub(matrix randomPoints(cR1,Homogeneous=>false),kk)); + subs1:=apply(#leftOverVars,i->leftOverVars_i => point_(0,i)); + assert(sub(cR1,subs1)==0); + --ring c === ring A1; + A2:=sub(sub(A1,subs1),R); + return sub(A2,random(R^1,R^(numgens R))); + ) + + + + +getFlatFamily=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) + +getFlatFamily(List,RR,ZZ) := o -> (L,r,n) -> ( + I := semigroupIdeal(L, "BaseField"=> o#"BaseField"); + if o.Verbose then ( + degsT1:=-def1 L; + << "unfolding" <(degree aa)_0<=ma*r+n); + runfolding:=unfolding%sub(restrict,SA); + if o.Verbose then ( + <<"flatteningRelations"<mA);) else ( + gbJ=forceGB gens gb(J,DegreeLimit=>mA);); + varsAmodJ:=vars A%gbJ; + J1:=sub(J,varsAmodJ); + family:=sub(runfolding,sub(vars S,SA)|sub(varsAmodJ,SA)); + if J1==0 then assert (betti syz family==betti syz gens I); + (I,J1,family)) + +isWeierstrassSemigroup=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) + +isWeierstrassSemigroup(List,RR) := o -> (L,r) -> ( + if o.Verbose then (elapsedTime degT1:=def1(L);) else degT1=def1(L); + truncations:=-unique select(degT1,d->d<0); + I:=semigroupIdeal L; + S:=ring I; + (A,unfolding):=makeUnfolding I; + ma:=max flatten (gens A/degree); + truncations=select(truncations,d->d ( + I:=null;S:=null;A:=null;unfolding:=null; + J1:=null; family:= null;ratio:=null;degT1:=null; + truncations:=null;ma:=null;t:=null;answer:=null; + ratios:=apply(LL,L -> ( + <d<0); + I=semigroupIdeal L; + S=ring I; + (A,unfolding)=makeUnfolding I; + ma=max flatten degrees A; + for t in truncations do ( + elapsedTime (<true) +L={6, 9, 14, 19, 22} +genus L + +apply(LL,L->(I=semigroupIdeal L; (A,unfolding)=makeUnfolding I; + mA= max flatten degrees A;degT1=-def1 L;(ma,max degT1))) + + + +elapsedTime isWeierstrassSemigroup L + + + +J1==0 +J1 +SA=ring family +ffam=res ideal family +ffam.dd_4 +isSmoothableSemigroup(L,0.2,0) +/// + +isARandomFiberSmooth=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) +isARandomFiberSmooth(Ideal,Ideal,Matrix) := o -> (I,J1,family) -> ( + S := ring I; + A := ring J1; + fib:=null;answer:= null; + if J1==0 then (fib = ideal sub(family,vars S|random(S^1,S^(numgens A))); + answer = heuristicSmoothness(fib); + if o.Verbose then <ideal map(A^1,,gens sub(c,matrix{ varsJ1}))); +*- + if o.Verbose then (<<"decompose" <( + A2=findPoint(c); + --point=sub(sub(h,A2),coefficientRing A); + point=sub(A2,coefficientRing A); + assert( + sub(J1,point)==0); + fib=ideal sub(family,vars S|point); + ---break return fib; + --assert(betti syz gens fib == betti syz gens I); + answer = heuristicSmoothness(fib); + -- singF=radical ideal gens gb (fib +minors(#mingens L-1,jacobian fib)); + if answer then -1 else 0 + --dim singF + )); + if o.Verbose then ( + << "support c, codim c: " <(#support c,codim c)) < + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) +heuristicSmoothness(Ideal) := o -> fib -> ( + --VerifyNonRegular:= null; + --regularInCodimension(1, (ring fib)/fib, VerifyNonRegular=>true, Verbose=>true) ) + jac := jacobian fib; + kk:=coefficientRing ring fib; + R1:=kk[support fib]; + points:= fib;N:=1; + numberOfSingPoints:=null;dimPoints:=null; + rad:=null;someMinors:=null; + while ( + someMinors = chooseGoodMinors(20*N,numgens ring fib-1,jac); + points = ideal gens gb (points+someMinors); + dimPoints=dim points; + if dimPoints>-1 then ( + rad = radical points; + numberOfSingPoints=degree sub(rad,R1);); + dimPoints>-1 and numberOfSingPoints>1 and N<2) do (N=N+1); + if dimPoints==-1 then return true; + jacpt:=sub(jac,vars ring fib%rad); + if numberOfSingPoints==1 then ( + return rank jacpt==codim fib) else ( + if o.Verbose then ( + <<"numberOfSingPoints "< ( + if #L<=3 then return true;--determinantal + if #L == 4 and type L == 1 then return true;--pfaffian + --if L is a generalized Arithmeti cProgression L + --then in some cases the paper of Oneto and Tamone shows smoothness + g := genus L; + if ewt L < g or min L <5 then return true else false) + +nonWeierstrassSemigroups=method(Options => + {Verbose => false, + "BaseField" => ZZ/(nextPrime 10^3)}) +nonWeierstrassSemigroups(ZZ,ZZ) := o -> (m,g) -> ( + LL:= findSemigroups(m,g); + LLa:=select(LL,L->not knownExample L); + if o.Verbose then <<(#LL,#LLa) < ( + if o.Verbose then (<6 ) do (r=r-0.05;if o.Verbose then (<<#LLa<(if o.Verbose then (< (m,g,LLdifficult) -> ( + LL:= findSemigroups(m,g); + LLa:=sort select(LL,L->not knownExample L); + <<(#LL,#LLa) <not isMember(L,LLdifficult)); + r:=0.6; + while ( elapsedTime LLa=select(LLa,L-> (<6 ) do (r=r-0.1); + <(< L -> ( + I := ideal kunzRing L; + mm := ideal vars ring I; + BI := (mm*I):(I:mm); + numcols basis (mm/(BI)) + ) +/// +restart +loadPackage("NumericalSemigroups", Reload => true) +L = {3,4,5} +isHomogeneous kunzRing L +burchIndex {3,4,5} + +/// +kunzRing = method() +kunzRing List := Ring => L -> ( + --returns the semigroup ring of R mod the multiplicity element + R := semigroupRing L; + m := min(gens R/degree); + newvars := select(gens R, x -> degree x > m); + newdegs := select(gens R/degree, d -> d>m); + S := coefficientRing R[newvars, Degrees => newdegs]; + S/trim sub(ideal R, S) + ) + +buchweitz = method() +buchweitz ZZ := List => i -> ( + --for i>=0 this produces a semigroup B with genus 16+i, conductor 26+2i, and + --#sums(2, gaps buchweitz i) = 3*(genus B -1)+1) + G := toList(1..12+i)| {19+2*i, 21+2*i, 24+2*i, 25+2*i}; + isGapSequence G) + +buchweitzSemigroups = method() +buchweitzSemigroups (ZZ, ZZ, ZZ) := (m,c,g) ->( + LL := findSemigroups(m,c,g); + if #LL !=0 then ( + LB := select(LL, L -> ( + G := gaps L; + #sums(G,G) > 3*(#G -1))); + --if #LB >0 then + -- (<( + LL := findSemigroups(m,g); + if #LL !=0 then ( + LB := select(LL, L -> ( + G := gaps L; + #sums(G,G) > 3*(#G -1))); + --if #LB >0 then + -- (<( + LL := findSemigroups g; + if #LL !=0 then ( + LB := select(LL, L -> ( + G := gaps L; + #sums(G,G) > 3*(#G -1))); + --if #LB >0 then + -- (< g ->( + + if g == 7 then print(" + LL7=findSemigroups 7;#LL7 + LL7a=select(LL7,L->not knownExample L);#LL7a + elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0)) + LL7b=={} -- => every genus 7 semigroup is Weierstrass + "); + + if g == 8 then print(" + LL8=findSemigroups 8;#LL8 + LL8a=select(LL8,L->not knownExample L);#LL8a + elapsedTime LL8b=select(LL8a,L-> not isSmoothableSemigroup(L,0.40,0)) -- 16.7345 seconds elapsed + LL8b=={{6,8,9,11}} + elapsedTime LL8c=select(LL8b,L-> not isWeierstrassSemigroup(L,0.15)) -- 1.88664 seconds elapsed + LL8c=={} -- => every genus 8 semigroup is Weierstrass + "); + + if g == 9 then print(" + LL9=findSemigroups 9;#LL9 + LL9a=select(LL9,L->not knownExample L);#LL9a + elapsedTime LL9b=select(LL9a,L->(not isSmoothableSemigroup(L,0.5,0)));#LL9b -- 134.401 seconds elapsed + LL9b + elapsedTime LL9c=select(LL9b,L->(not isSmoothableSemigroup(L,0.4,0))); -- 26.7357 seconds elapsed + LL9c=={} -- => every genus 8 semigroup is Weierstrass + "); + + if g == 10 then print(" + LL10=findSemigroups 10;#LL10 + LL10a=select(LL10,L->not knownExample L);#LL10a + elapsedTime LL10b=select(LL10a,L-> elapsedTime not isSmoothableSemigroup(L,0.6,0)); -- 418.486 seconds elapsed + #LL10b + elapsedTime LL10c=select(LL10b,L->(<(<(< every genus 10 semigroup is Weierstrass + "); + + if g == 11 then print(" + LL11=findSemigroups 11;#LL11 + LL11a=select(LL11,L->not knownExample L);#LL11a + last LL11a, last LL11 -- shows that all examples of genus 11 not covered by Plueger have multiplicity <= 10. + + elapsedTime nonWeierstrassSemigroups(5,11) -- 117.422 seconds elapsed - + LLdifficult={{6, 8, 17, 19, 21},{6, 8, 10, 19, 21, 23},{6, 9, 11, 14}} + elapsedTime nonWeierstrassSemigroups(6,11,LLdifficult,Verbose=>true) -- 267.818 seconds elapsed + --(6, 11, all but difficult semigroups are smoothable) + elapsedTime LL611=select(LLdifficult,L->(<true))); -- 197.l321 seconds elapsed + + elapsedTime nonWeierstrassSemigroups(7,11, LLdifficult, Verbose => true) --257 sec + LLdifficult={{8, 9, 11, 15, 21}} + elapsedTime nonWeierstrassSemigroups(8,11, LLdifficult, Verbose => true) + LLdifficult={} + elapsedTime nonWeierstrassSemigroups(9,11, LLdifficult, Verbose => true) + LLdifficult={} + elapsedTime nonWeierstrassSemigroups(10,11, LLdifficult, Verbose => true) + "); + ) + + + +/// +restart +debug loadPackage( "NumericalSemigroups", Reload => true) +LL11=findSemigroups 11;#LL11 + LL11a=select(LL11,L->not knownExample L);#LL11a + last LL11a, last LL11 -- shows that all examples of genus 11 not covered by Plueger have multiplicity <= 10. + +LabBookProtocol 7 + LL7=findSemigroups 7;#LL7 + LL7a=select(LL7,L->not knownExample L);#LL7a + elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0,Verbose=>true)) + elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0)) + LL7b=={} + + LL8=findSemigroups 8;#LL8 + LL8a=select(LL8,L->not knownExample L);#LL8a + elapsedTime LL8b=select(LL8a,L-> not isSmoothableSemigroup(L,0.40,0)) -- 16.7345 seconds elapsed + LL8b=={{6,8,9,11}} + elapsedTime LL8c=select(LL8b,L-> not isWeierstrassSemigroup(L,0.15)) -- 1.88664 seconds elapsed + LL8c=={} -- => every genus 8 semigroup is Weierstrass + + LL9=findSemigroups 9;#LL9 + LL9a=select(LL9,L->not knownExample L);#LL9a + elapsedTime LL9b=select(LL9a,L->(not isSmoothableSemigroup(L,0.5,0)));#LL9b -- 134.401 seconds elapsed + LL9b + elapsedTime LL9c=select(LL9b,L->(not isSmoothableSemigroup(L,0.4,0))); -- 26.7357 seconds elapsed + LL9c=={} -- => every genus 9 semigroup is Weierstrass + + + LL10=findSemigroups 10;#LL10 + LL10a=select(LL10,L->not knownExample L);#LL10a + elapsedTime LL10b=select(LL10a,L-> elapsedTime not isSmoothableSemigroup(L,0.6,0)); -- 418.486 seconds elapsed + #LL10b + elapsedTime LL10c=select(LL10b,L->(<(<(< every genus 10 semigroup is Weierstrass + + elapsedTime nonWeierstrassSemigroups(5,11,Verbose =>true) -- 117.422 seconds elapsed - + + LLdifficult={{6, 8, 17, 19, 21},{6, 8, 10, 19, 21, 23},{6, 9, 11, 14}} + elapsedTime nonWeierstrassSemigroups(6,11,LLdifficult,Verbose=>true) -- 267.818 seconds elapsed + --(6, 11, all but difficult semigroups are smoothable) + elapsedTime LL611=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + + + LLdifficult ={} + elapsedTime nonWeierstrassSemigroups(7,11,LLdifficult,Verbose=>true) -- 267.818 seconds elapsed + elapsedTime LL711=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + -- 951.724 seconds elapsed + --o3 == {} + + LLdifficult ={{8, 9, 11, 15, 21}} + elapsedTime nonWeierstrassSemigroups(8,11,LLdifficult,Verbose=>true) + elapsedTime LL811=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + + + LLdifficult ={} + elapsedTime nonWeierstrassSemigroups(9,11,LLdifficult,Verbose=>true) + elapsedTime LL911=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + -- 998.636 seconds elapsed + o4 = {} + + LLdifficult ={} + elapsedTime nonWeierstrassSemigroups(10,11,LLdifficult,Verbose=>true) + elapsedTime LL1011=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + -- 2104.78 seconds elapsed + --o5 == {} + + + LLdifficult = {{6, 9, 17, 19, 20, 22},} + elapsedTime nonWeierstrassSemigroups(6,12,LLdifficult,Verbose=>true) + elapsedTime LL612=select(LLdifficult,L->(<true))); -- 197.321 seconds elapsed + + + + + + LLdifficult={} + elapsedTime nonWeierstrassSemigroups(5,12,LLdifficult,Verbose=>true) -- 152.485 seconds elapsed + oo == {} + + LLdifficult={} + elapsedTime nonWeierstrassSemigroups(7,12,LLdifficult,Verbose=>true) -- 152.485 seconds elapsed + oo == {} + + + + +/// + numberToMonomial = (R, n) -> ( + --n should be an element of the semigroup from which R is made. + --Thus if n \equiv i mod m, we can express m as x_0^p*x_i + b := basis(n, R); + if b==0 then error"No element of degree n in R"; + (entries b)_0_0 + ) + +fractionalIdeal = method(Options => {"Ideal" => true}) +fractionalIdeal(List, List) := o -> (sgrp, mons) -> ( + --sgrp is a list of ZZ_{>0}, interpreted as generators of a semigroup; + --mons is a list of ZZ interpreted as generating a module in the quotient field of sgrp + --with the option "Ideal" => false we get a list of integers, otherwise an ideal. + if not gcd sgrp == 1 then error"sgrp has wrong quotient field"; + c := conductor sgrp; + mons0 := min mons; + ans := {c}; -- a default value. + ss := semigroup sgrp; + nonGens :=sums(sgrp, mons); + newMons := sort (mons | nonGens); + for i from -mons0 to c do( + newMonsPlus := sums({i}, newMons); + m := select(newMonsPlus, j -> j true) + sgrp = {5,9} + R = semigroupRing sgrp + mons = semigroup sgrp + apply(mons, n -> numberToMonomial(R,n)) + fractionalIdeal(sgrp, mons_{4..7}) + numberToMonomial(R,23) +sgrp = {4,7,10,13} +mons = {3,4} -- generators of first blowup +semigroup sgrp +R = semigroupRing sgrp +n = 7 +numberToMonomial(R,7) +fractionalIdeal(sgrp, mons, "Ideal"=>false) +fractionalIdeal(sgrp, mons) + +/// +-* Documentation section *- + +beginDocumentation() + + +document { +Key => NumericalSemigroups, +Headline => "Compute invariants of a numerical semigroup", + "In this package we consider numerical semigroups: that is, cofinite subsets of the natural numbers that are closed under sums. + We generally refer to these simply as semigroups. + + A semigroup S thus includes the empy sum, 0, but we input semigroups by giving generators, all nonzero. + The smallest nonzero element of S is the multiplicity. The Apery set (really sequence) of a semigroup S is the + the list {a_1..a_m-1} where a_i is the smallest element in S such that a_i = i mod m. + The conductor is 1 plus the largest element not in S. We generally specify a semigroup by giving + a list of positive integers L with gcd = 1, representing the semigroup of all sums of + elements of L.", + + PARA{}, + SUBSECTION "Combinatorial properties of the Kunz cone", + UL{ + TO coneEquations, + TO mu, + TO facetRays, + TO coneRays, + TO allSemigroups, + TO findSemigroups, + TO buchweitzCriterion, + TO buchweitz, + TO buchweitzSemigroups, + }, + SUBSECTION "Properties of semigroup rings", + UL{ + TO burchIndex, + TO semigroupRing, + TO socle, + TO kunzRing, + TO isSymmetric + }, + SUBSECTION "Weierstrass semigroups", + "The question whether every semigroup is a Weierstrass semigroup was answered negatively + by Buchweitz: the semigroup generated by {13, 14, 15, 16, 17, 18, 20, 22, 23} is not a Weierstrass semigroup, + as demonstrated in ", TO buchweitz,". + On the other hand Pinkham gave a positve criterion with deformation theory. + A semigroup is a Weierstrass semigroup if and only if the graded semigroup ring of L + has a smoothing deformation with strictly positive deformation parameters.", + PARA{}, + + "In this section we implemented Pinkham's approach in POSITIVE CHARACTERISTIC. We plan + to extend the smoothing results to characteristic 0 in the future.", + UL{ + TO makeUnfolding, + TO flatteningRelations, + TO getFlatFamily, + TO findPoint, + TO isARandomFiberSmooth, + TO heuristicSmoothness, +-- TO isSmoothableSemigroup, + TO isWeierstrassSemigroup, + TO nonWeierstrassSemigroups, + TO LabBookProtocol, + } +} + +doc /// +Key + LabBookProtocol + (LabBookProtocol, ZZ) +Headline + Weierstrass Semigroups in Low genus +Usage + s = LabBookProtocol g +Inputs + g:ZZ + genus +Outputs + s:String + commands to study semigroups of genus g +Description + Text + This function prints a series of commands that check that most semigroups of genus g (up to g = 10) are Weierstrass. + It outputs a short list of "difficult" examples that currently take too long to check. + Example + LabBookProtocol 7 + LL7=findSemigroups 7;#LL7 + LL7a=select(LL7,L->not knownExample L);#LL7a + elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0,Verbose=>true)) + elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0)) + LL7b=={} + Text + With the option Verbose=>true one gets timings on various parts of the computation. + To check all semigroups of genus g=8,9 and 10 takes about + + 18.2, 161.1 and 945.6 seconds respectively. + + Example + LabBookProtocol 11 + Text + Since the number of cases gets rather large, we break up the list of all semigroups + into sublists of semigroups of given multiplicity and call the function nonWeierstrassSemigroups: + Example + m=5,g=8 + elapsedTime nonWeierstrassSemigroups(m,g,Verbose=>true) + Text + In the verbose mode we get timings of various computation steps and further information. + The first line, + (13,1), + indicates that there 13 semigroups of multiplicity 5 and genus 8 of which only 1 is not flagged + as smoothable by the function knownExample. + The second line, + {5,8,11,12}, + gives the current semigroup. + The timing under various headers tells how much time was used in each of the steps. + Example + L={6,8,9,11} + genus L + isWeierstrassSemigroup(L,0.2,Verbose=>true) + Text + The first integer, 6, tells that in this attempt deformation parameters of degree >= 6 were used and no smooth fiber was found. + Finally with all parameters of degree >= 4, the flatteningRelations define a scheme that decomposes into 2 components, + both affine spaces. If we encounter non affine components we print "has to solve", and find a point in each such component. + We then print the number of singular points in the fiber. + Finally the output "{0,-1}" is the dimension of the singular loci of a random fiber over each component. + Thus the entry "-1" indicates that a general fiber of the second component is smooth. + +SeeAlso + isSmoothableSemigroup + isWeierstrassSemigroup + nonWeierstrassSemigroups + knownExample +/// + +doc /// +Key + knownExample + (knownExample, List) +Headline + Is L a known Weierstrass semigroup? +Usage + b = knownExample L +Inputs + g:ZZ + genus +Outputs + b:Boolean + true if L is a known example of a Weierstrass semigroup +Description + Text + Certain semigroups are known to be Weierstrass. For example L has 2 or 3 generators only, by work of Pinkham and Sally. + Another sort examples are semigroup with small weight ewt(L) < genus L by the work Nathan Pflueger extending + work of Eisenbud-Harris. + Example + L={7,12,13} + knownExample L + L={7,8,9,11,13} + ewt L, genus L + knownExample L + LL=findSemigroups(9,10);#LL + select(LL,L->not knownExample L) + #oo +SeeAlso + LabBookProtocol + findSemigroups +/// + +doc /// +Key + buchweitzCriterion + (buchweitzCriterion, List) + (buchweitzCriterion,ZZ,List) +Headline + Does L satisfies the Buchweitz criterion? +Usage + d = buchweitzCriterion L + d = buchweitzCriterion(m,L) +Inputs + L:List + generators of a semigroup or the aperyset of a semigroup + m:ZZ + the multiplicity of the semigroup +Outputs + d:ZZ +Description + Text + A Weierstrass semigroups L satisfies + + 3*(genus L-1) -#sums(G,G) >=0. + + The function returns this difference. + + Example + L={7,12,13} + buchweitzCriterion L + L= buchweitz 0 + buchweitzCriterion L + (H,M)=allSemigroups L + b=(entries M)_0 + g=(entries H)_0 + apply(3,i->buchweitzCriterion(13,b+i*g)) + +SeeAlso + buchweitz +/// + +doc /// +Key + apery + (apery, List) +Headline + Compute the apery set, multiplicity and conductor +Usage + A = apery L +Inputs + L: List + of positive integers +Outputs + A:HashTable +Description + Text + The smallest nonzero element of s is the \emph{multiplicity}. The Apery set (really sequence) of a semigroup S is the + the list {a_1..a_m-1} where a_i is the smallest element in s such that a_i = i mod m. + The \emph{conductor} is 1 plus the largest element \emph{not} in S. We generally specify a semigroup by giving + a list of positive integers L with gcd = 1, representing the semigroup of all sums of + elements of L. + Example + L = {3,5} + apery L +SeeAlso + aperySet +/// + +doc /// +Key + aperySet + (aperySet, List) + (aperySet, HashTable) +Headline + Compute the apery set of a numerical semigroup +Usage + as = aperySet L + aS = aperySet HL +Inputs + L: List + of positive integers + H: HashTable + as computed by H = apery L +Outputs + aS: List +Description + Text + L is taken as generators of a numerical semigroup S; should have gcd = 1. + The apery set is then the list aS = {a_1..a_(m-1)} where m is the smallest + element of L, and a_i is the smallest element of S with a_i = i mod m. + Example + aperySet {3,5} + semigroup {3,5} +SeeAlso + apery +/// + +doc /// +Key + semigroup + (semigroup, List) +Headline + Compute the semigroup generated by a list of positive integers +Usage + L = semigroup L0 +Inputs + L0: List +Outputs + L: List +Description + Text + The semigroup is actually computed by the function apery, and + semigroup L = (apery L)#"semigroup" + Example + semigroup {5,4} +SeeAlso + apery +/// + +doc /// +Key + isSymmetric + (isSymmetric, List) +Headline + test whether the semigroup generated by L is symmetric +Usage + t = isSymmetric L +Inputs + L: List +Outputs + t: Boolean +Description + Text + Suppose that c = conductor S, so that c-1 is the last gap. If x in S, and x (i+1)+(b_i*m)) +SeeAlso + aperySet +/// + + +doc /// +Key + (genus, List) +Headline + Compute the number of gaps (genus) of a semigroup +Usage + g = genus L +Inputs + L: List +Outputs + g: ZZ +Description + Text + The gaps S is the list of the finitely many positive integers not in S + Example + genus {4,7} + G = gaps {4,7} + #G + S = semigroup{4,7} + set G + set S == set(0..21) +SeeAlso + gaps + semigroup +/// + +doc /// +Key + kunzMatrix + (kunzMatrix, List) + (kunzMatrix, HashTable) +Headline + determine the set of facet equations satisfied by a semigroup +Usage + M = kunzMatrix L + M = kunzMatrix H +Inputs + L: List + H: HashTable + such as produced by apery +Outputs + M: Matrix + of 0s and 1s +Description + Text + The equations defining the facets of the homogeneous Kunz cone P_m^* + are + E_(i,j): a_i+a_j = a_(i+j mod m) for those (i,j) such that i+j != 0 mod m. + + Given a list L generating the semigroups s + with Apery set a = {a_1..a_i}, M = kunzMatrix L has a 1 in the (i,j) position + if and only if a satisfies equation E_(i,j). Thus M = kunzMatrix L + is a symmetric matrix of 0s and 1s that determines the face + of the kunz cone P on which it lies. + Example + L = {4,7} + aperySet L + kunzMatrix L +SeeAlso + aperySet +/// +doc /// +Key + findSemigroups + (findSemigroups, ZZ, ZZ, ZZ) + (findSemigroups, ZZ, ZZ) + (findSemigroups, ZZ) +Headline + Find all semigroups with a given number of gaps, multiplicity and/or conductor + +Usage + LL = findSemigroups(mult, cond, numgaps) + LL = findSemigroups(mult, numgaps) + LL = findSemigroups(numgaps) +Inputs + mult: ZZ + multiplicity + cond: ZZ + conductor + numgaps: ZZ + number of gaps +Outputs + LL: List + of sequences of generators of semigroups with the given invariants +Description + Text + If S is the Weierstrass semigroup of a point p on a Riemann surface X -- that + is, the semigroup of pole orders of rational functions at p, + then the genus of X is the number of gaps of S and there is a + differential on X vanishing to order exactly d iff d+1 is a gap. + Example + findSemigroups(5,14,8) + G = gaps {5,7,9} + #G + Text + The number of vanishing orders of quadratic differentials + on is h^0(2K) = (4g-4) - g + 1 = 3g-3, + so if s is the semigroup of pole orders of a point on X + and G is the set of gaps, then there can be at most 3g-3 distinct + sums of pairs of elements of G. This gives a nontrivial obstruction + to the smoothability of the semigroup ring of S and thus to the + existence of a Weierstrass point with semigroup s. + + The following example, discovered by Ragnar Buchweitz (Thesis) + was the first known example of a non-Weierstrass semigroup. + Example + G=toList(1..12)|{19,21,24,25} + Text + The function @TO isGapSequence@ returns generators for + the semigroups with given gap sequence or returns false if there is + no such semigroup + Example + L=isGapSequence G + g = #G + 3*g-3 + #sums(G,G) +SeeAlso + isGapSequence + gaps +/// + +/// +restart +debug loadPackage("NumericalSemigroups",Reload=>true) +G=toList(1..12)|{19,21,24,25} +L=isGapSequence G +I=semigroupIdeal L +S=ring I +inI=trim ideal(gens I%S_0) +fI=res I +degrees fI_2 +elapsedTime (A,unfolding)=makeUnfolding I; -- 14.1952 seconds elapsed +numgens A +tally degrees A + +elapsedTime J=flatteningRelations(I,A,unfolding); +elapsedTime gb J; dim J; +elapsedTime (A1=vars A%J) + +/// + + + + +doc /// +Key + (mingens, List) +Headline + Find a mininmal set of semigroup generators +Usage + L' = mingens L +Inputs + L: List + generators of a semigroup +Outputs + L': List + minimal generators of the same semigroup +Description + Text + The set of generators is minimal if it has empty + intersection with the set of sums of non-zero generators. + + It would have been nicer to overload @TO mingens@ to + accept a list. + Example + L = semigroup {3,7} + mingens L +SeeAlso + semigroup +/// + +doc /// +Key + socle + (socle, List) +Headline + elements of the semigroup that are in the socle mod the multiplicity +Usage + socle L +Inputs + L:List + generators of a semigroup +Outputs + L:List + subset of the Apery set representing the socle mod the multiplicity +Description + Text + Let S = semigroup L + be a numerical semigroup with minimal non-zero element m, + and consider the artinian ring + A(s) = k[{t^i : i in s]/(t^m). + The socle of A(s) is the sum of the minimal nonzero ideals, + and socle L is a set of generators of the socle + Example + L = {3,7} + s = semigroup L + socle L + L = {3,4,5} + s = semigroup L + socle L +SeeAlso + semigroup +/// + + doc /// +Key + type + (type, List) +Headline + type of the local semigroup ring +Usage + r = type L +Inputs + L:List + of semigroup generators +Outputs + r: ZZ + the type +Description + Text + The type of a local Cohen-Macaulay ring is the number + of generators of the canonical module, or equivalently the + dimension of the socle of an zero-dimensional reduction. + + For example, the type of a complete intersection such as + the semigroup ring of a semigroup generated by 2 elements. + Example + type {3,5} +SeeAlso + socle +/// +doc /// +Key + gaps + (gaps, List) +Headline + The gap sequence of a semigroup +Usage + G = gaps L +Inputs + L: List + of semigroup generators +Outputs + G: List + the gap sequence +Description + Text + If semigroup L is the Weierstrass semigroup of a Riemann surface + C at a point, then #gaps L = g = h^0(omega_C), the genus of C. Furthermore, + the number of elements of sums(n, G) is bounded by the dimension of + h^0(omega_C^n) = n*(2g-2)-g+1 = (2n-1)g-2n+1. However, for + an arbitrary semigroup the number #sums(n,G) may be larger; + the first such example was found by Ragnar Buchweitz, and + is given below. + + The function isGapSequence returns either false or generators + of the semigroup of which the sequence is the gap sequence. + + Example + G=toList(1..12)|{19,21,24,25} + g = #G + for n from 1 to 3 list (#sums(n,G),n*(2*g-2) - g + 1) + L=isGapSequence G + G ==gaps L +Caveat +SeeAlso + isGapSequence + findSemigroups +/// +doc /// +Key + sums + (sums, List, List) + (sums, ZZ, List) +Headline + sum of two sequences +Usage + L = sums(L1, L2) + L = sums(n,L1) +Inputs + L1: List + L2: List + n:ZZ +Outputs + L:List +Description + Text + sums(L1,L2) returns a sorted list of the unique + sums of nonzero elements of L1 with L2; + sums(n, L1) returns the sorted list of unique sums + of n nonzero elements of L1. + Example + L1 = {2,3} + L2 = {4,5} + sums(L1, L2) + sums(1, L1) == L1 + sums(L1, L1) + sums(2,L1) + Text + Of course the sequence of arbitrary sums of elements including 0 + is essentially semigroup L. To get just the sums of n elements, + one could write: + Example + n = 3 + {0}|sort unique flatten (for i from 1 to n list sums(i,L1)) +/// + +doc /// +Key + def1 + (def1, List) +Headline + degrees of a basis of T^1 +Usage + D = def1 L +Inputs + L: List + generators of a semigroup +Outputs + D: List + degrees of a basis of T^1(semigroupRing L) +Description + Text + T^1(B) is the tangent space to the versal deformaion of + the ring B, and is finite dimensional when B has isolated + singularity. If B = S/I is a Cohen presentation, then + T^1(B) = coker Hom(Omega_S, B) -> Hom(I/I^2, B). + When B is a semigroup ring, then Henry Pinkham proved that + an open subset of the space of elements of T1 of + negative degree correspond to smoothings of the projective cone + of the semigroup ring to Riemann surfaces + Example + def1{2,3} +/// + +doc /// +Key + (conductor, List) +Headline + conductor of a semigroup +Usage + c = conductor L +Inputs + L:List + of generators of a semigroup +Outputs + c:ZZ + conductor of the semigroups +Description + Text + Semigroups in this package are additively closed + cofinite subsets of ZZ_{>= 0}. The conductor + is the smallest element c such that c+i is + in the semigroup for all i >= 0. For a semigroup + generated by two elements a,b, the conductor + is (a-1)(b-1), but for semigroups with more + generators there is no known formula. + Example + conductor {3,5} + conductor {5, 7, 9, 13} +/// + +doc /// +Key + facetRays + (facetRays, List) +Headline + computes the rays spanning the face in which a semigroup lies +Usage + R = facetRays L +Inputs + L:List + of generators of a semigroup +Outputs + R:Matrix + of integers; the columns are the rays + of the face on which semigroup L lies +Description + Text + Uses the Fourier-Motzkin algorithm to go from + the @TO coneEquations@ satisfied by the semigroup + to the rays. For example, in multiplicity 3, + the cone has two rays, occupied by the + semigroups semigroup{3,4} and semigroup{3,5}, + with semigroup{3,4,5} in the interior. + The rays are given in reduced form (a vector + of positive integers with gcd 1), and appear + as the columns of the output matrix. + Example + aperySet{3,4} + facetRays{3,4} + facetRays{3,5} + facetRays{3,4,5} + Text + On the face with the @TO buchweitz@ example there are two facet rays: + Example + F = facetRays buchweitz 0 + Text + The second column is mu buchweitz 0, the mu vector of the Buchweitz example. + Adding multiples of it to the Weierstrass semigroups ordinary point + of genus 12, we eventually reach a semigroup that fails the Buchweitz + test to be a Weierstrass semigroup: + Example + b = {0}|flatten entries F_{1} + L = toList (13..25) + for i from 0 to 15 list ( + L' = L+i*13*b; + G = gaps L'; + #sums(G, G) - 3*(genus L' -1) + ) + Text + We conjecture that the same phenomen for any semigroup L0 + of multiplicity 13 in place of L. Here is a "random" example: + Example + setRandomSeed 0 + L0 = {13}|aperySet ({13}|apply(1 + random 10, i->13+random 10)) + for i from 0 to 20 list ( + L' = L0+i*13*b; + G = gaps L'; + #sums(G, G) - 3*(genus L' -1) + ) +SeeAlso + aperySet + coneEquations + coneRays +/// + + +doc /// +Key + allSemigroups + (allSemigroups, List) + (allSemigroups, ZZ) +Headline + Compute the Hilbert basis and module generators of a cone of semigroups +Usage + (H,M) = allSemigroups L + (H,M) = allSemigroups m +Inputs + L:List + of generators of a semigroup + m: ZZ + the multiplicity of the semigroups +Outputs + H:Matrix + of integers; the rows form the Hilbert basis of the cone + M:Matrix + of module generators of the cone +Description + Text + Using Normaliz we compute the face of the Kunz cone containg L. + In case of allSemigroups m the output descibes the complete Kunz cone + of all semigroups of multiplicity m. + Example + allSemigroups {4,7,9} + allSemigroups 4 + Text + On the face with the @TO buchweitz@ example there are two facet rays: + Example + (H,M) = allSemigroups buchweitz 0 + Text + The first row of H is 13*(mu buchweitz 0), the mu vector of the Buchweitz example. + Adding multiples of the first row to the Weierstrass semigroups of an ordinary point + on a curve of genus 12, we eventually reach a semigroup that fails the Buchweitz + test to be a Weierstrass semigroup: + Example + b = {0}|flatten (entries H)_0 + L = toList (13..25) + for i from 0 to 15 list ( + L' = L+i*b; + G = gaps L'; + 3*(genus L' -1)-#sums(G,G) + ) + Text + By Riemann-Roch the quantity 3*(genus L' -1)-#sums(G,G) is non-negative + for Weierstrass semigroups. + We conjecture that the same thing is true for any semigroup L0 + of multiplicity 13 in place of L. Here is a "random" example: + Example + setRandomSeed 0 + L0 = {13}|aperySet ({13}|apply(1 + random 10, i->13+random 10)) + for i from 0 to 20 list ( + L' = L0+i*b; + G = gaps L'; + 3*(genus L' -1)-#sums(G,G) + ) +SeeAlso + aperySet + coneEquations + buchweitzCriterion +/// + +doc /// +Key + semigroupRing + (semigroupRing, List) + [semigroupRing, "BaseField"] +Headline + forms the semigroup ring over "BaseField" +Usage + A = semigroupRing L +Inputs + L:List + of semigroup generators +Outputs + A:Ring + algebra over "BaseField" +Description + Text + If the basering is kk, the semigroup ring + is A = kk[x^S] where x^S denotes the set of + monomials in variables x_i with exponent + vectors in S, and kk is the field that is the value + of the option "BaseField" (ZZ/101 by default). + + If m is the multiplicity of S, + the semigroup ring depends up to an + isomorphism that may change the degrees, + only on the face of the Kunz cone + in which the semigroup lies. + + Semigroup rings are interesting as + examples, and arise as Weierstrass semigroups + of points on algebraic curves: if p in C + is such a point, then the Weierstrass semigroup + of C at p is the set of pole orders of rational + functions with poles only at p, and the + semigroupRing is the associated graded ring of the filtered ring + $\bigcup_{n >= 0} H^0(O_C(np))$. + For non-Weierstrass + points the semigroup is 0,g+1,g+2.., and there are + finitely many "Weierstrass" point p + whose semigroup has weight >=2. + + For example if C is a smooth plane quartic, + then at each ordinary flex point, the semigroup is + 0,3,5,6,7,.. + + Example + semigroupRing {3,4,5} + weight {4,5,6,7}, gaps {4,5,6,7} + semigroupRing {4,5,6,7} + weight {3,5,7}, gaps {3,5,7} + semigroupRing {3,5,7} + weight {3,4}, gaps {3,4} + semigroupRing({3,4}, "BaseField" => QQ) +SeeAlso + semigroupIdeal + weight + /// + +doc /// +Key + makeUnfolding + (makeUnfolding, Ideal) + (makeUnfolding, List) + [makeUnfolding, "BaseField"] + [makeUnfolding, Verbose ] +Headline + Makes the universal homogeneous unfolding of an ideal with positive degree parameters +Usage + (A,unfolding) = makeUnfolding I + (A,unfolding) = makeUnfolding sgrp +Inputs + I:Ideal + sgrp:List + generators of a semigroup +Outputs + A: Ring + algebra of unfolding parameters + unfolding: Matrix + equations of the unfolding +Description + Text + Given a (quasi)homogenous ideal in a ring S = kk[x_0..x_n] + the function creates a positively graded polynomial ring A = kk[a_{i,j}] + and computes the unfolding of I as an ideal + of SA = kk[x_0..x_n, a_{i,j}]. This can be used as a step in computing the + semi-universal deformation of the affine cone defined by I. + + In the case of + + makeUnfolding sgrp + + the routine first forms the ideal of the semigroup ring, and applies makeUnfolding to this. + Example + L={4,5,7} + I := semigroupIdeal L; + (A,unfolding):= makeUnfolding I; + S=ring I + fI=res I + degs=flatten (gens A/degree) + n=floor(max degs/2+3) + restricted=ideal select(gens A, y-> (degree y)_0 (degree y)_0true) + Text + In the verbose mode we get timings of various computation steps and further information. + The first line, + (17,5), + indicates that there 17 semigroups of multiplicity 6 and genus 8 of which only 5 is not flagged + as smoothable by the function knownExample. + The second line, + {6, 7, 8, 17}, + gives the current semigroup. + The timing under various headers tells how much time was used in each of the steps. +SeeAlso + isWeierstrassSemigroup + LabBookProtocol + /// + + + + + + + + +doc /// +Key + getFlatFamily + (getFlatFamily, List, RR, ZZ) + [getFlatFamily, "BaseField"] + [getFlatFamily, Verbose ] +Headline + Compute the flat family depending on a subset of parameters of the universal unfolding +Usage + (I,J1,family)=getFlatFamily(L,RR,ZZ) +Inputs + L:List + the generators of a semigroup + r:RR + n:ZZ + numbers which influences the truncation +Outputs + I: Ideal + semigroup ideal + J1:Ideal + flatness relations among the parameters + family: Matrix + defining equation of the family +Description + Text + After computing an unfolding and restricting the + unfolding to variables of degree larger than + + (maximal degree of a parameter)*r+n, + + we compute the flattening relations and remove dependent variables. + The remaining flattening relation are returned in the ideal J1. + Using the function isARandomFiberSmooth we then can check with good luck + whether a random fiber over some component of J1 is smooth. + Example + L={6,8,10,11} + genus L + (I,J1,family)=getFlatFamily(L,0.30,0); + betti res ideal family == betti res I + isARandomFiberSmooth(I,J1,family) + support family + support family /degree + gens ring J1 /degree + Text + Parameters of the universal unfolding of degree <= 22*0.3 are not used + Example + (I,J1,family)=getFlatFamily(L,0.00,11); + support family + support family /degree + Text + Parameters of the universal unfolding of degree < 11) are not used + Example + isARandomFiberSmooth(I,J1,family) + A = ring family + transpose family +SeeAlso + makeUnfolding + flatteningRelations + getFlatFamily + isARandomFiberSmooth + /// + +doc /// +Key + isARandomFiberSmooth + (isARandomFiberSmooth, Ideal, Ideal, Matrix) + [isARandomFiberSmooth, "BaseField"] + [isARandomFiberSmooth, Verbose ] +Headline + Test whether a random fiber is smooth +Usage + b=isARandomFiberSmooth(I,J1,family) +Inputs + I: Ideal + semigroup ideal + J1:Ideal + flatness relations among the parameters + family:Matrix + a flat family +Outputs + b: Boolean + true if a random fiber is smooth, false otherwise +Description + Text + We check whether a random fiber over a random closed point of each component of J1 is smooth. + If we find a smooth fiber we return true, else we return false. + Example + L={6,8,10,11} + genus L + (I,J1,family)=getFlatFamily(L,0.30,0); + isARandomFiberSmooth(I,J1,family) + SA=ring family + transpose family +SeeAlso + makeUnfolding + flatteningRelations + getFlatFamily + /// + + doc /// +Key + heuristicSmoothness + (heuristicSmoothness, Ideal) + [heuristicSmoothness, "BaseField"] + [heuristicSmoothness, Verbose ] +Headline + Check whether an affine curve is smooth +Usage + b=heuristicSmoothness c +Inputs + c: Ideal + of an affine curve +Outputs + b: Boolean + true if the computation showes that c is smooth false otherwise +Description + Text + We check for smoothness using only some of the minors of + the jacobian matrix. If we are lucky this establishes smoothness. + With bad luck we might fail even in case when c is smooth. + Example + kk=ZZ/2; S=kk[x_0..x_3] + setRandomSeed "some singular and some smooth curves"; + elapsedTime tally apply(10,i-> ( + c=minors(2,random(S^2,S^{3:-2})); + c=sub(c,x_0=>1); + R=kk[support c];c=sub(c,R); + heuristicSmoothness c)) +SeeAlso + +/// + +doc /// +Key + buchweitz + (buchweitz, ZZ) +Headline + An example of a semigroup that is not a Weierstrass semigroup +Usage + L = buchweitz i +Inputs + i:ZZ +Outputs + L:List + generators of a semigroup +Description + Text + For i>=0 this produces a semigroup B with genus 16+i, conductor 26+2i, and + #sums(2, gaps buchweitz i) = 3*(genus B -1)+1). This implies + that these semigroups are NOT Weierstrass semigroups by the + following argument, first employed by Buchweitz: + + If L generates the Weierstrass semigroup of a point x + on a Riemann surface C, then the gaps L is the + set {1+v | v is the order at p of vanishing of a global + section of \omega_C}. Thus + sums(d, #gaps L) <= dim H^0(\omega_C^{d) = d*(2g-1) - g + 1. + Example + B = buchweitz 0 + g = #gaps B + m = 3 + 2*(2*g-2) - g + 1 + #sums(2, gaps B) + Text + More such semigroups can be found with @TO buchweitzSemigroups@ +Acknowledgement + The result was written in Ragnar Buchweitz' These d'Etat, + but never otherwise published by Buchweitz. In the meantime it became + famous anyway. +/// + +doc /// +Key + buchweitzSemigroups + (buchweitzSemigroups, ZZ) + (buchweitzSemigroups, ZZ, ZZ) + (buchweitzSemigroups, ZZ, ZZ, ZZ) +Headline + Finds semigroups that are not Weierstrass semigroups by the Buchweitz test +Usage + LL = buchweitzSemigroups g + LL = buchweitzSemigroups (m,g) + LL = buchweitzSemigroups (m,c,g) +Inputs + g:ZZ + genus + m:ZZ + mutiplicity + c:ZZ + conductor +Outputs + LL:List + list of semigroups +Description + Text + Uses findSemigroups to produce lists of semigroups with the given + invariants, and then uses the Buchweitz test: the following + inequality holds for Weierstrass semigroups: + sums(2, #gaps L) <= dim H^0(\omega_C^{2) = 2*(2g-1) - g + 1. + Example + B = buchweitzSemigroups (13,26,16) + buchweitz 0 + B = buchweitzSemigroups (14,28,17) + Text + The second example in these two cases are part of the sequence defined in @TO buchweitz@. As g increases + there are many more. + Example + #buchweitzSemigroups (15,30,18) +SeeAlso + buchweitz + findSemigroups +/// + + +doc /// +Key + isGapSequence + (isGapSequence, List) +Headline + test whether a list of integers can be the list of gaps of a semigroup +Usage + L = isGapSequence G +Inputs + G: List +Outputs + L:Boolean + L:List +Description + Text + The function isGapSequence returns either false or + a list of generators + of the semigroup of which the sequence is the gap sequence. + Note that the gap sequence of a semigroup of multiplicity m + begins with 1..m-1, and ends with the Frobenius number c-1, + where c is the conductor. + Example + G = {1,2,3,4,6,9,11,14} + isGapSequence G + G = {1,2,3,4,6,9,11} + S = isGapSequence G + G == gaps S +SeeAlso + gaps +/// + +doc /// +Key + ewt + effectiveWeight + (ewt, List) + (effectiveWeight, List) +Headline + Effective weight of a semigroup (Pflueger) +Usage + w = ewt L +Inputs + L: List + generators of a semigroup +Outputs + w: ZZ + the effective weight +Description + Text + The effective weight of a semigroup S is defined as the number + of pairs (a,b) such that a is a minimal generator of S and b is a gap of S with a "x"] + [semigroupIdeal, "MinimalGenerators"=>true] + [semigroupIdeal, "BaseField" => ZZ/101] +Headline + The ideal defining the semigroup ring +Usage + I = semigroupIdeal L +Inputs + L: List +Outputs + I: Ideal +Description + Text + The semingroup ideal of the semigroup generated by L + is the kernel of the map kk[x_0..x_(#L)] -> kk[t] + sending x_i to t^(L_i), where kk is the specified BaseField, + defaulting to ZZ/101 and x is the specified VariableName. + If the option "MinimalGenerators" is set to true, the default, then + the program first computes a minimal set of generators from L; + if it is set to false, the program uses L itself. + Example + semigroupIdeal {5,7} + semigroupIdeal({5,7,10}, "MinimalGenerators" => false) +SeeAlso + mingens + semigroupRing +/// +doc /// +Key + aperySemigroupRing + (aperySemigroupRing, List) +Headline + computes the semigroup ring using both the multiplicity and the full Apery set +Usage + R = aperySemigroupRing L +Inputs + L: List +Outputs + R: Ring +Description + Text + While the function semigroupRing L uses just a minimal set of generators, + the function aperySemigroupRing L uses the larger Apery set, and puts + the generator corresponding to the multiplicity at the end. + Example + L = {5,6} + aperySet L + gens aperySemigroupRing L + gens semigroupRing L +SeeAlso + semigroupRing + aperySet + mingens +/// + +/// +restart +loadPackage ("NumericalSemigroups", Reload => true) +uninstallPackage "NumericalSemigroups" +restart +installPackage "NumericalSemigroups" +check "NumericalSemigroups" +--<0}, interpreted as generators of a semigroup; + mons is a list of ZZ interpreted as generating a module in the quotient field of sgrp + with the option "Ideal" => false we get a list of integers belonging to the semigroup, + otherwise a proper ideal of the semigroup ring. + of the ring semigroupRing sgrp. In both cases, the program chooses the + generators of least possible degree. + + This is perhaps most useful when regarding a blowup or iterated blowup as a module + over the original ring. For example, the sequence of blowups of the semigroupRing {5,9} + is given by semigroupRing{4,5}, semigroupRing{1}: + Example + sgrp = {5,9} + sgrp1 = {4,5} + sgrp2 = {1} + fractionalIdeal(sgrp, sgrp1, "Ideal"=>false) + fractionalIdeal(sgrp, sgrp2) +SeeAlso + semigroupRing +/// + +doc /// +Key + coneEquations + (coneEquations, ZZ) + (coneEquations, List) + [coneEquations, "Inhomogeneous"] +Headline + Find the equations of the Kunz cones +Usage + M = coneEquations m + M = coneEquations sgrp +Inputs + m:ZZ + multiplicity + sgrp:List + generators of a semigroup +Outputs + M:Matrix + m-1 x d matrix whose columns represent inequalities defining the Kunz cone +Description + Text + Let S be the numerical semigroup defined by a list sgrp, + have multiplicity m and apery set a_1,\dots,a_(m-1) and + set mu_i = (a_i -i)//m. The homogeneous Kunz cone of + semigroups of multiplity m is the convex polyhedral cone + defined by the inequalities of the form + + a_i + a_j - a_(i+j) \geq 0. + + where 1\leq i,j\leq m-1 and i+j\neq m is interpreted mod m. + The function coneEquations m returns an m-1 x d matrix of ZZ + whose columns are the coefficients of the left hand sides of these inequalities. + The function coneEquations sgrp does the same, with additional columns representing + the additional inequalities of this type that are satisfied by + the Apery set apery(sgrp). For m = 3, the semigroup {3,4,5} is interior (and thus + satisfies no further equations), while the semigroups {3,4} and {3,5} are on + the two extremal rays of the cone. + Example + coneEquations 3 + coneEquations {3,4,5} + coneEquations {3,4} + coneEquations {3,5} + allSemigroups 3 + Text + The inhomogeneous Kunz cone does the same, but for the numbers mu_i instead of + a_i. Thus when i+j > m the inequality mu_i+mu_j-mu_(i+j) \geq 0 is replaced by the inequality + + mu_i+mu_j - mu_(i+j) -1. + + The function coneEquations(m, "Inhomogeneous" => true) returns the same matrix + as in the homogeneous case, with one more row, where the last row represents the + constant terms of this inquality: + Example + eq=coneEquations(3, "Inhomogeneous" => true) + coneEquations({3,4,5}, "Inhomogeneous" => true) + coneEquations({3,4}, "Inhomogeneous" => true) + coneEquations({3,5}, "Inhomogeneous" => true) + (H,M)=allSemigroups 3 + (H,M)=allSemigroups 4 + M1=(M|matrix apply(rank target M,i->{-1})) + eqInh=coneEquations(4, "Inhomogeneous" => true) + eqh=coneEquations(4) + M1*eqInh + H*eqh + Text + All entries of M1*eqInh and H*eqh are non-negative as desired. +References + Kunz, Ernst: Klassification numerische Halbgruppen +Caveat +SeeAlso + apery + coneRays +/// + +doc /// +Key + coneRays + (coneRays, ZZ) +Headline + All the rays of the (homogeneous) Kunz cone +Usage + M = coneRays m +Inputs + m:ZZ + multiplicity +Outputs + M:Matrix + of ZZ -- columns are vectors on the rays of the cone +Description + Text + Uses the Fourier-Motzkin algorithm to compute the rays from the list of supporting hyperplanes, + which is given by @TO coneEquations@. The number of rays grows rather quickly with m; + the actual number is unknown. Use @TO facetRays@ to determine the rays bounding the face + on which a given semigroup lies. + Example + coneRays 3 + coneRays 4 + facetRays {4,5,6} +SeeAlso + coneEquations + facetRays +/// + + +--< true) + sgrp = {3,5} + R = semigroupRing sgrp + mons = semigroup sgrp + assert(apply(mons, n -> numberToMonomial(R,n)) == {1, x_0, x_2, x_0^2, x_0*x_2, x_0^3, x_2^2}) + assert( + I := fractionalIdeal(sgrp, {2,3}); + R := ring I; + I == ideal(R_1,R_0^2) + ) +/// + + TEST ///-*buchweitzSemigroups*- +assert(buchweitzSemigroups 6 == {}) +--elapsedTime buchweitzSemigroups(13,16) +/// + +TEST///-*test of findPoint*- +kk=ZZ/101 +R=kk[x_0..x_5] +setRandomSeed 0 +c=ideal random(R^1,R^{2:-1,2:-2}) +point=findPoint c +assert(sub(c,point)== 0) +/// + +TEST///-*flattening and unfolding*- +assert ((L = mingens {5,6, 8,9, 10,12, 13, 17}) == {5, 6, 8, 9}) +I=semigroupIdeal L +(A,unfolding)=makeUnfolding I; +assert(numgens A == 68) +J=flatteningRelations(I,A,unfolding); +numgens J +assert(numgens J == 260) +/// + +TEST/// -*aperySemigroupRing *- +L = {5,6} +assert(aperySet L == {6, 12, 18, 24}) +assert(numgens aperySemigroupRing L == 1+ #aperySet L) +/// + +TEST/// -*semigroupIdeal*- +I = semigroupIdeal({4,5}, + "VariableName"=> z, + "BaseField" => ZZ/3, + "MinimalGenerators"=>false) +assert(char ring I == 3 and +toString I == toString ideal(z_0^5-z_1^4)) +/// + +TEST/// -*mu*- +assert(mu{5,7} == {4, 1, 5, 2}) +assert(mu apery{5,7} == {4, 1, 5, 2}) +/// + + +TEST/// -*buchweitz*- +i = 2 +gaps (B = buchweitz i) +assert(#sums(2, gaps buchweitz i) == 3*(genus B -1)+1) +/// + +TEST/// -*def1*- +assert(def1{2,3} == {-6, -4}) + +/// + +TEST/// -*burchIndex*- +assert(burchIndex {6,7,8,9,10,11} == 5 and +burchIndex (L = {3,4,5}) == 2 and +burchIndex {6,19,22, 35} == 0 and -- this is Gorenstein and +burchIndex {14, 19, 21, 29, 36} == 3 +) +/// + + +TEST/// -*sums*- + L1 = {2,3} + L2 = {4,5} + assert (sums(L1, L2) == {6,7,8}) + assert(sums(1, L1) == L1) + assert(sums(2,L1) == {4,5,6}) +/// + +TEST///-*gaps*- +assert((G = gaps{3,5}) == {1, 2, 4, 7}) +s = select (semigroup {3,5}, i -> i < conductor{3,5}) +assert(#G==#s) +/// + +TEST///-*findSemigroups*- +assert(findSemigroups(3,8,4) == {{3,5}}) +assert(findSemigroups(5,14,8) == { + {5, 7, 11}, + {5, 7, 9}, + {5, 6, 14}, + {5, 9, 11, 12}}) +/// + +TEST///-*type*- +assert(type {3,4} == 1 and type {5,6,7,8,9} == 4) +/// + + +TEST ///-* Buchweitz example of nonsmoothable semigroup and isGapSequence*- +G=toList(1..12)|{19,21,24,25} +L=isGapSequence G +G1=gaps L +G1==G +assert(#sums(G1,G1)>3*(#G1-1)) +/// + +TEST///-*mingens*- +assert ((L = mingens {5,6, 8,9, 10,12, 13, 17}) == {5, 6, 8, 9}) +assert(mingens {3, 5, 8, 9, 10}== {3,5}) +assert(mingens ({3, 4, 5, 6, 7, 9, 10, 12}) == {3,4,5}) +assert(mingens {3,3,5,5} == {3,5}) +assert(mingens semigroup {3,7} == {3,7}) +assert(mingens {8, 10, 31, 129, 130} == {8, 10, 31}) +/// + + +TEST///-*socle*- +L = {9, 23, 28, 31} +socle L == {84, 79, 62} +/// + +TEST/// -*conductor*- +assert(conductor {7, 24} == 6*23) +/// + +TEST///-*test of facetRays*- +assert(facetRays{3,4} == matrix"1;2") +assert(facetRays{3,5} == matrix"2;1") +assert(facetRays{3,4,5} == matrix"1,2;2,1") +/// + + +TEST///-*test of option*- + R = semigroupRing({3,5,7}, "BaseField" => QQ) + assert(char R == 0) + /// + +TEST///-*test of allSemigroups*- + (H,M)=allSemigroups 3 + assert(H==matrix{{3,3},{3,6},{6,3}}) + assert(M==matrix{{4,5},{4,8},{7,5},{10,5}}) +/// + + +TEST///-*test of coneEquations*- + (H,M)=allSemigroups 3 + eq=coneEquations 3 + assert(all(flatten entries (H*eq),e->e>=0)) + eqInh=coneEquations(3,"Inhomogeneous" => true) + M1=(M|matrix apply(rank target M,i->{-1})) + assert(all(flatten entries (M1*eqInh),e->e>=0)) +/// + +end-- + +-* Development section *- +restart +loadPackage ("NumericalSemigroups", Reload=>true) +uninstallPackage "NumericalSemigroups" +restart +installPackage "NumericalSemigroups" +check "NumericalSemigroups" +viewHelp "NumericalSemigroups" + + + +L1={13,14,15,16,17,18,20,22} +(gL1,bL1)=allSemigroups L1 +buchweitzCriterion L1 +b=aperySet L1 +g=(entries gL1)_2 +apply(10,i->(L=prepend(13,b+i*g);G=gaps L;-#sums(G,G)+3*(#G-1))) +L=prepend(13,b+2*g) + +G=gaps L;#sums(G,G)-3*(#G-1) +(gL,bL)=allSemigroups L +gL= +first entries gL1 +#bL +netList apply(bL,b->tally flatten apply(5,i->apply(4,j->(Lbij=prepend(15,(b+i*gL 0+j*gL_1)); + G=gaps Lbij; (#sums(G,G)-3*(#G-1)))))) +(g,b)=allSemigroups LL_1 +g=7 +elapsedTime LL=flatten apply(toList(2..g),m->findSemigroups(m,2*g,g)) + + + + +L=buchweitz 20 +L=mingens ({10}|apply(7,i->random((i+1)*11)+11)) +m=min L +a=aperySet L +am=mu apery L +am +G=gaps L + +Gm=apply(m-1,i->select(G,j->j%m==i+1)) +apply(m,k-> #unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {}))-max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) + + + +--netList apply(m,k-> apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then +-- (sums(Gm_(i-1),Gm_(j-1))) else {}))) + + +sum(m,k-> (mk=max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0)); + ki=select(toList(1..m-1),i->(j=(k-i)%m; + j=!=0 and am_(i-1)+am_(j-1)-1 ==mk)); + max apply(ki,i->(j=(k-i)%m;mk+if i+j>m then 1 else 0))))-1 +oo==#sums(G,G) + +sum(m,k->max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1+if i+j>m then 1 else 0) else 0)))-1 +oo==#sums(G,G) +#G,3*(#G-1) +buchweitzCriterion L + +L={13}|apply(9,i->i+1+13)|apply(3,i->i+1+11+2*13) +aperySet L +(B,M)=allSemigroups L +g=((entries B)_0)_({0..4}|{9,6,9,7,8,10,11}) +b=(entries M)_0 +Lis=apply(10,i->{13}|b+i*g) +apply(Lis,L->buchweitzCriterion L) + + + + + + + +apply(m,k-> max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (#sums(Gm_(i-1),Gm_(j-1))) else 0))) + +#sums(G,G) + +apply(m,k-> unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {})))== +apply(m,k->select(sums(G,G),j->j%m==k)) + +apply(m,k-> max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (#sums(Gm_(i-1),Gm_(j-1))) else 0)))== +apply(m,k-> max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) + +apply(m,k-> all apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (#sums(Gm_(i-1),Gm_(j-1)))==(am_(i-1)+am_(j-1)-1) else true))) + + +sort flatten apply(m,k-> unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {})))== +sums(G,G) + +sum(m,k-> max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) +== +#sums(G,G) + + +))) +apply(m,k-> unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {}))) +netList apply(m,k-> apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {}))) + + +apply(m,k-> unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {})))== +apply(m,j->select(sums(G,G),i->i%m==j)) +apply(m,k-> #unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {}))==max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) + +sum(m,k->#select(sums(G,G),i->i%m==k)) +#sums(G,G) +sum(m,k-> max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) + +tally apply(m,k-> #unique flatten apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (sums(Gm_(i-1),Gm_(j-1))) else {}))==max apply(toList(1..m-1),i->(j=(k-i)%m; if j=!=0 then + (am_(i-1)+am_(j-1)-1) else 0))) + +18, 24, 25, 26, 28, 30, 33 + + From 174b1f30b037826d12a64481bd7237254d580eb8 Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 09:52:35 -0700 Subject: [PATCH 174/226] adding =dist... --- M2/Macaulay2/packages/=distributed-packages | 1 + 1 file changed, 1 insertion(+) diff --git a/M2/Macaulay2/packages/=distributed-packages b/M2/Macaulay2/packages/=distributed-packages index d0a594af972..7909b1da360 100644 --- a/M2/Macaulay2/packages/=distributed-packages +++ b/M2/Macaulay2/packages/=distributed-packages @@ -276,3 +276,4 @@ MultigradedImplicitization Msolve Permutations SCMAlgebras +NumericalSemigroups From ec381fad00ef6f8cf7147770799ae13d7bac71c0 Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 10:13:16 -0700 Subject: [PATCH 175/226] NumericalSemigroups.m2 --- M2/Macaulay2/packages/NumericalSemigroups.m2 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/M2/Macaulay2/packages/NumericalSemigroups.m2 b/M2/Macaulay2/packages/NumericalSemigroups.m2 index c3dd1dc7f90..4de4bb79a79 100644 --- a/M2/Macaulay2/packages/NumericalSemigroups.m2 +++ b/M2/Macaulay2/packages/NumericalSemigroups.m2 @@ -1,13 +1,14 @@ newPackage( "NumericalSemigroups", - Version => "0.1", - Date => "March 12, 2024", + Version => "1.0", + Date => "October 25, 2024", Headline => "Compute the Apery set and invariants of a numerical semigroup ring", Authors => {{ Name => "David Eisenbud", Email => "de@berkeley.edu", HomePage => "eisenbud.github.io"}, { Name => "Frank-Olaf Schreyer", Email => "schreyer@math.uni-sb.de", HomePage => "https://www.math.uni-sb.de/ag/schreyer/index.php/publications/publications-frank-olaf-schreyer"}}, AuxiliaryFiles => false, - DebuggingMode => true, - PackageExports => {"FourierMotzkin","Normaliz", "IntegralClosure", "FastMinors", "RandomPoints"} + DebuggingMode => false, + PackageExports => {"FourierMotzkin","Normaliz", "IntegralClosure", "FastMinors", "RandomPoints"}, + Keywords => {"Commutative Algebra", "Algebraic Geometry", "Combinatorics"} ) /// restart @@ -22,6 +23,7 @@ viewHelp "NumericalSemigroups" viewHelp Normaliz /// +--"done" indicates that there is a TEST installed for that function. export { "apery", --done FOS "aperySet", --done FOS @@ -60,7 +62,6 @@ export { "isARandomFiberSmooth", --done FOS "getFlatFamily", --done FOS "isWeierstrassSemigroup", -- done FOS --- "estimateTruncationRatio", "nonWeierstrassSemigroups", -- done FOS "LabBookProtocol", --done FOS "fractionalIdeal", --done From f23bf688b1f2fe7d94aa25454d2cb4a531fbc2f4 Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 10:19:18 -0700 Subject: [PATCH 176/226] edited spelling --- M2/Macaulay2/packages/NumericalSemigroups.m2 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/M2/Macaulay2/packages/NumericalSemigroups.m2 b/M2/Macaulay2/packages/NumericalSemigroups.m2 index 4de4bb79a79..1bcfd34d722 100644 --- a/M2/Macaulay2/packages/NumericalSemigroups.m2 +++ b/M2/Macaulay2/packages/NumericalSemigroups.m2 @@ -855,7 +855,7 @@ flatteningRelations(Ideal,Ring, Matrix) := (I,A,unfolding) -> ( SA := ring unfolding; chMat:=getChangeMatrix gbI; unfoldingGB := unfolding*sub(chMat,SA); - -- can one use the build in gb algorithm to copute the + -- can one use the build in gb algorithm to compute the -- flattening relations faster unfGBf:=forceGB unfoldingGB; ldT := flatten entries leadTerm unfoldingGB; @@ -1439,7 +1439,7 @@ Headline => "Compute invariants of a numerical semigroup", "In this package we consider numerical semigroups: that is, cofinite subsets of the natural numbers that are closed under sums. We generally refer to these simply as semigroups. - A semigroup S thus includes the empy sum, 0, but we input semigroups by giving generators, all nonzero. + A semigroup S thus includes the empty sum, 0, but we input semigroups by giving generators, all nonzero. The smallest nonzero element of S is the multiplicity. The Apery set (really sequence) of a semigroup S is the the list {a_1..a_m-1} where a_i is the smallest element in S such that a_i = i mod m. The conductor is 1 plus the largest element not in S. We generally specify a semigroup by giving @@ -1471,7 +1471,7 @@ Headline => "Compute invariants of a numerical semigroup", "The question whether every semigroup is a Weierstrass semigroup was answered negatively by Buchweitz: the semigroup generated by {13, 14, 15, 16, 17, 18, 20, 22, 23} is not a Weierstrass semigroup, as demonstrated in ", TO buchweitz,". - On the other hand Pinkham gave a positve criterion with deformation theory. + On the other hand Pinkham gave a positive criterion with deformation theory. A semigroup is a Weierstrass semigroup if and only if the graded semigroup ring of L has a smoothing deformation with strictly positive deformation parameters.", PARA{}, @@ -2224,8 +2224,8 @@ Outputs of module generators of the cone Description Text - Using Normaliz we compute the face of the Kunz cone containg L. - In case of allSemigroups m the output descibes the complete Kunz cone + Using Normaliz we compute the face of the Kunz cone containing L. + In case of allSemigroups m the output describes the complete Kunz cone of all semigroups of multiplicity m. Example allSemigroups {4,7,9} @@ -2348,7 +2348,7 @@ Outputs equations of the unfolding Description Text - Given a (quasi)homogenous ideal in a ring S = kk[x_0..x_n] + Given a (quasi)homogeneous ideal in a ring S = kk[x_0..x_n] the function creates a positively graded polynomial ring A = kk[a_{i,j}] and computes the unfolding of I as an ideal of SA = kk[x_0..x_n, a_{i,j}]. This can be used as a step in computing the From d219d8751f92c48fa6819d92a38c4df3941cd396 Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 13:21:06 -0700 Subject: [PATCH 177/226] fixed a url --- M2/Macaulay2/packages/NumericalSemigroups.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/NumericalSemigroups.m2 b/M2/Macaulay2/packages/NumericalSemigroups.m2 index 1bcfd34d722..521506c20ac 100644 --- a/M2/Macaulay2/packages/NumericalSemigroups.m2 +++ b/M2/Macaulay2/packages/NumericalSemigroups.m2 @@ -3,7 +3,7 @@ newPackage( Version => "1.0", Date => "October 25, 2024", Headline => "Compute the Apery set and invariants of a numerical semigroup ring", - Authors => {{ Name => "David Eisenbud", Email => "de@berkeley.edu", HomePage => "eisenbud.github.io"}, + Authors => {{ Name => "David Eisenbud", Email => "de@berkeley.edu", HomePage => "http://eisenbud.github.io"}, { Name => "Frank-Olaf Schreyer", Email => "schreyer@math.uni-sb.de", HomePage => "https://www.math.uni-sb.de/ag/schreyer/index.php/publications/publications-frank-olaf-schreyer"}}, AuxiliaryFiles => false, DebuggingMode => false, From acfcf1dccecdcbb3577049741589cf5af162a57e Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 14:57:10 -0700 Subject: [PATCH 178/226] adding new version of PencilsOfQuadrics.m2 --- M2/Macaulay2/packages/PencilsOfQuadrics.m2 | 775 +++++++++++++++++++-- 1 file changed, 716 insertions(+), 59 deletions(-) diff --git a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 index f9083268fee..78b2f1d1b6a 100644 --- a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 +++ b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 @@ -9,25 +9,26 @@ viewHelp "PencilsOfQuadrics" needsPackage"CompleteIntersectionResolutions" loadPackage("PencilsOfQuadrics", Reload=>true) peek loadedFiles - /// + newPackage( "PencilsOfQuadrics", - Version => "0.9", - Date => "June 17, 2020", + Version => "1.0", + Date => "October 10, 2024", Authors => {{Name => "Frank-Olaf Schreyer", Email => "schreyer@math.uni-sb.de", HomePage => ""}, {Name => "David Eisenbud", Email => "de@msri.org", - HomePage => "https://www.msri.org/~de"}, + HomePage => "www.msri.org/~de"}, {Name => "Yeongrak Kim", - Email => "kim@math.uni-sb.de", - HomePage => "https://sites.google.com/view/yeongrak"} + Email => "yeongrak.kim@pusan.ac.kr", + HomePage => "sites.google.com/view/yeongrak"} }, - PackageExports => {"CompleteIntersectionResolutions"}, + PackageExports => {"CompleteIntersectionResolutions"}, Headline => "Clifford Algebra of a pencil of quadratic forms", - Keywords => {"Commutative Algebra"} + DebuggingMode => false, + Keywords => {"Commutative Algebra", "Algebraic Geometry"} ) export { @@ -36,9 +37,9 @@ peek loadedFiles "RandomNicePencil", "cliffordOperators",-- "centers",-- - -- "tensorProduct", - "randomLineBundle", + "preRandomLineBundle", -- methods updated in ver 1.0 + "randomLineBundle", -- methods updated in ver 1.0 -- "Nontrivial", -- an option which is not used in ver 0.2 "degOnE", -- "degreeOnE", @@ -75,9 +76,10 @@ peek loadedFiles "VectorBundleOnE", "vectorBundleOnE", "yAction", - "searchUlrich", + "searchUlrich", -- methods updated in ver 1.0 "translateIsotropicSubspace", - "randomIsotropicSubspace" + "randomIsotropicSubspace", + "LabBookProtocol", } needsPackage"CompleteIntersectionResolutions" @@ -94,6 +96,319 @@ CliffordModule = new Type of MutableHashTable VectorBundleOnE = new Type of MutableHashTable RandomNicePencil = new Type of MutableHashTable +LabBookProtocol=method() +LabBookProtocol(ZZ) := (g) -> ( + if g==3 then ( + print " + g=3 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 0.644455 seconds elapsed + M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + elapsedTime while ( + m1=randomLineBundle(g+(g%2),f); + m2=randomLineBundle(g%2,f); + m12=randomExtension(m1.yAction,m2.yAction); + V = vectorBundleOnE m12; + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 0.337555 seconds elapsed + betti Ul.yAction, betti Ul1.yAction + --further commands + elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 9.35977 seconds elapsed + M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + r=2 + Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + Ulr=coker map(S^(r*2^g),,Ulrich); + minimalBetti Ulr + -- will give an Ulrich bundle, with betti table + -- 16 32 16") + else + if g==4 then ( print " + g=4 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 9.29588 seconds elapsed + M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + elapsedTime while ( + m1=randomLineBundle(g+(g%2),f); + m2=randomLineBundle(g%2,f); + m12=randomExtension(m1.yAction,m2.yAction); + V = vectorBundleOnE m12; + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 2.27561 seconds elapsed + betti Ul.yAction, betti Ul1.yAction + --further commands + elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 419.895 seconds elapsed + M1Ul:=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + r=2 + Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + Ulr=coker map(S^(r*2^g),,Ulrich); + minimalBetti Ulr + -- will give an Ulrich bundle, with betti table + -- 32 64 32 + ") else + if g==5 then ( print " + g=5 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 56.2955 seconds elapsed + elapsedTime M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + elapsedTime while ( + m1=randomLineBundle(g+(g%2),f); + m2=randomLineBundle(g%2,f); + m12=randomExtension(m1.yAction,m2.yAction); + V = vectorBundleOnE m12; + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 29.9208 seconds elapsed + betti Ul.yAction, betti Ul1.yAction + -- -- the further commands + -- Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- add timing + -- M1Ul:=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + -- r=2 + -- Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + -- Ulr=coker map(S^(r*2^g),,Ulrich) + -- minimalBetti Ulr + -- -- will give an Ulrich bundle, with betti table + -- 64 128 64 + ") + else (print "no record") + ) + +LabBookProtocol(ZZ,ZZ) := (g,r) -> ( + if (g,r)==(2,3) then ( + print " + g=2 + r=3 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 0.1028558 seconds elapsed + P=kk[drop(gens S,-2)] + gens P + M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + degSeq={0,1,2} + elapsedTime while ( + -- build a vector bundle V as extensions of line bundles of degrees in degSeq + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 0.181415 seconds elapsed + betti Ul.yAction,betti Ul1.yAction + --further commands + elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 1.15852 seconds elapsed + M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + Ulrich = coker map(P^(r*2^g),,sub(M1Ul^{r*2^g..(2*r)*2^g-1},P)); + minimalBetti Ulrich + -- Is an Ulrich bundle, with betti numbers + -- r*2^g,(2*r)*2^g,r*2^g + elapsedTime qs=ann Ulrich + ideal sub(diff((vars S)_{2*g+2,2*g+3},qq),P)==qs + ") else + if (g,r)==(3,4) then ( print " + g=3 + r=4 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 0.623928 seconds elapsed + P=kk[drop(gens S,-2)] + gens P + M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + degSeq={1,2,3,4} + elapsedTime while ( + -- build a vector bundle V as extensions of line bundles of degrees in degSeq + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 1.15312 seconds elapsed + betti Ul.yAction,betti Ul1.yAction + --further commands + elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 87.5896 seconds elapsed + M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + Ulrich = coker map(P^(r*2^g),,sub(M1Ul^{r*2^g..(2*r)*2^g-1},P)); + minimalBetti Ulrich + -- Is an Ulrich bundle, with betti numbers + -- r*2^g,(2*r)*2^g,r*2^g + elapsedTime qs=ann Ulrich + -- 25.3661 seconds elapsed + ideal sub(diff((vars S)_{2*g+2,2*g+3},qq),P)==qs + ") else + if (g,r)==(4,3) then ( print " + g=4; + r=3; + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 9.41219 seconds elapsed + elapsedTime M=cliffordModule(Mu1,Mu2,R) + P=kk[drop(gens S,-2)]; + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + degSeq={0,2,4} + elapsedTime while ( + -- build a vector bundle V as extensions of line bundles of degrees in degSeq + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 7.34427 seconds elapsed + betti Ul.yAction,betti Ul1.yAction + --further commands + -- elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 1814.76 seconds elapsed + -- M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + -- Ulrich = coker map(P^(r*2^g),,sub(M1Ul^{r*2^g..(2*r)*2^g-1},P)); + -- minimalBetti Ulrich + -- Is an Ulrich bundle, with betti numbers + -- r*2^g,(2*r)*2^g,r*2^g + -- elapsedTime qs=ann Ulrich + -- 522.132 seconds elapsed + -- ideal sub(diff((vars S)_{2*g+2,2*g+3},qq),P)==qs + ") + else (print "no record") + ) + +/// +LabBookProtocol 3 +LabBookProtocol 4 +LabBookProtocol 5 + g=5 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 56.2955 seconds elapsed + elapsedTime M=cliffordModule(Mu1,Mu2,R) + -- 12.8458 seconds elapsed + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + elapsedTime while ( + m1=randomLineBundle(g+(g%2),f); + m2=randomLineBundle(g%2,f); + m12=randomExtension(m1.yAction,m2.yAction); + V = vectorBundleOnE m12; + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 29.9208 seconds elapsed + betti Ul.yAction, betti Ul1.yAction + -- -- the further commands + -- elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- + -- M1Ul:=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + -- r=2 + -- Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + -- Ulr=coker map(S^(r*2^g),,Ulrich) + -- minimalBetti Ulr + -- -- will give an Ulrich bundle, with betti table + -- 64 128 64 + +LabBookProtocol 6 +LabBookProtocol(2,3) +LabBookProtocol(3,4) + +LabBookProtocol(4,3) + g=4; + r=3; + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 9.41219 seconds elapsed + elapsedTime M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + degSeq={0,2,4} + elapsedTime while ( + -- build a vector bundle V as extensions of line bundles of degrees in degSeq + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 7.34427 seconds elapsed + betti Ul.yAction,betti Ul1.yAction + --further commands + --elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- add timing + --M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + --Ulrich = coker map(P^(r*2^g),,sub(M1Ul^{r*2^g..(2*r)*2^g-1},P)); + --minimalBetti Ulrich + -- Is an Ulrich bundle, with betti numbers + -- r*2^g,(2*r)*2^g,r*2^g + --elapsedTime qs=ann Ulrich + -- + --ideal sub(diff((vars S)_{2*g+2,2*g+3},qq),P)==qs + +/// + matrixFactorizationK=method() matrixFactorizationK(Matrix,Matrix) := (X,Y) -> ( @@ -164,7 +479,7 @@ randomNicePencil(Ring,ZZ) := (kk,g) -> ( X -- is the irrelevant ideal of PP^(2g+1) Y -- Y is the coefficient vector of qq written as a linear combination of X assert(X*transpose Y==qq) - u -- are the linear equations defining a maximal isotropic subspace + u -- are the linear equations defining a maximal isotropic saubspace betti M1, betti M2 -- is the matrix factorization of qq -- corresponding to the resolution of kk betti Mu1, betti Mu2 -- is the matrix factorization of qq @@ -342,7 +657,6 @@ assert(c0^2-(-1)^d*determ*id_(target c0)==0) assert(c1^2-(-1)^d*determ*id_(source c1)==0) /// - factorToList = method() factorToList(Product) := pf ->( lpf := toList pf; @@ -354,9 +668,10 @@ factorToList(Product) := pf ->( assert (f == product factorToList factor f) /// --randomLineBundle=method(Options => {Nontrivial =>true}) -randomLineBundle=method() + +preRandomLineBundle=method() -- the option is not used -randomLineBundle( RingElement ) := f -> ( +preRandomLineBundle( RingElement ) := f -> ( --produces a 2x2 matrix factorization of f, hence a line bundle on the hyperelliptic curve. --corresponding to y^2-(-1)^g*f. --the first matrix has the form @@ -376,8 +691,93 @@ randomLineBundle( RingElement ) := f -> ( m:=map(targetm,, matrix{{b,c},{a,-b}}); assert(isHomogeneous m); vectorBundleOnE m + + -- an output of this method will be mostly unbalanced -- deg(a) and deg(c) may have a big gap. + -- in the case, the corresponding line bundle will lie on a (twisted) theta divisor (or a Brill-Noether loci) + -- so we need a method to find a "general" one by tensoring a number of degree 0 line bundles ) +preRandomLineBundle(ZZ,RingElement) := (d,f) -> ( +-- f a binary form of degree 2g+2 over a finite field +-- d an integer +-- select randomly a line L of degree d on the hyperelliptic curve +-- defined by y^2-(-1)^g*f + while (L:=preRandomLineBundle f; a:=d-degOnE L; a%2 !=0) do (); + R:= ring f; + Ld := vectorBundleOnE (L.yAction**R^{-a//2}); + if d == 0 then + while (member({0},degrees target Ld.yAction)) do( + Ld = preRandomLineBundle (d,f); + ); + Ld +) + +randomLineBundle=method() +randomLineBundle(RingElement) := (f) -> ( +-- Input +-- f: a binary form of degree 2g+2 over a finite field + +-- Output : a (much more balanced) random line bundle of degree d on the corresponding hyperelliptic curve. + if ((# gens ring f) != 2 or ((degree f)_0)%2 !=0) then error "f should be a binary form of degree 2g+2"; + if (char ring f)==0 then error "define f over a finite field"; + + g:=(degree f)_0 // 2 - 1; + Ld := preRandomLineBundle(f); + + for i from 1 to g-1 do( + L0 := preRandomLineBundle(0,f); + Ld = tensorProduct(Ld,L0); + ); + Ld + ) + +randomLineBundle(ZZ, RingElement) := (d,f) -> ( +-- Input +-- d: an integer +-- f: a binary form of degree 2g+2 over a finite field + +-- Output : a (much more balanced) random line bundle of degree d on the corresponding hyperelliptic curve. + if ((# gens ring f) != 2 or ((degree f)_0)%2 !=0) then error "f should be a binary form of degree 2g+2"; + if (char ring f)==0 then error "define f over a finite field"; + + g:=(degree f)_0 // 2 - 1; + Ld := preRandomLineBundle(d,f); + + for i from 1 to g-1 do( + L0 := preRandomLineBundle(0,f); + Ld = tensorProduct(Ld,L0); + ); + Ld + ) + + +TEST/// +--test of preRandomLineBundle and randomLineBundle +restart +load "PencilsOfQuadrics.m2" +kk = ZZ/nextPrime(10^3) +R = kk[ s,t] +g = 3 + +f = random(2*g+2, R) +assert(dim ideal(jacobian ideal f)== 0) + +d=random(ZZ) + +tally apply(100, i->( +preLd=preRandomLineBundle(d,f); +betti preLd.yAction)) + +tally apply(100, i->( +Ld=randomLineBundle(d,f); +betti Ld.yAction)) + + + +/// + + + --randomMatrixFactorization = method(Options => {Nontrivial =>true}) randomMatrixFactorization=method() randomMatrixFactorization(RingElement) := f -> ( @@ -450,20 +850,7 @@ orderInPic(VectorBundleOnE) := L->( if numrows M != 2 or degOnE L != 0 then error("expected bundle to have rank 1 and degree 0"); orderInPic M) -randomLineBundle(ZZ,RingElement) := (d,f) -> ( --- f a binary form of degree 2g+2 over a finite field --- d an integer --- select randomly a line L of degree d on the hyperelliptic curve --- defined by y^2-(-1)^g*f - while (L:=randomLineBundle f; a:=d-degOnE L; a% 2 !=0) do (); - R:= ring f; - Ld := vectorBundleOnE (L.yAction**R^{-a//2}); - if d == 0 then - while (member({0},degrees target Ld.yAction)) do( - Ld = randomLineBundle (d,f); - ); - Ld - ) + /// -- Experiments on the order of Pic^0 of an elliptic curve over a finite field @@ -911,20 +1298,153 @@ searchUlrich(CliffordModule,Ring) :=(M,S) -> ( coker map(S^(2^(g+1)),,Ulrich) ) + + +searchUlrich(CliffordModule,Ring,ZZ) := (M,S,r) ->( + -- Input + -- r: integer at least 2 + -- M: a Clifford Module associated to a pencil of quadrics in PP^(2g+1) + -- S: associated ring of polynomials (2g+2 variables for PP^(2g+1), and two variables s, t for parametrizing the pencil of quadrics) + + -- Output: an Ulrich module of rank r*2^(g-2) + + -- By Riemann-Roch, we need a rank r vector bundle E of degree r(g-2)/2, or a twist by a line bundle + -- so we are tempting to find a rank r, degree rg/2 vector bundle by extensions of r line bundles. + + Mor := vectorBundleOnE M.evenCenter; + Mor1:= vectorBundleOnE M.oddCenter; + f := M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + + g:=degree ideal f//2-1; + if (numgens S != 2*g+4) then error "S should be a polynomial ring in (2g+4) variables"; + if (rank source M.evenCenter != 2^(g+1)) then error "M should be a Clifford module associated to a maximal isotropic subspace"; + + if (r <= 1) then error "r should be at least 2"; + if ((r*g)%2 != 0) then error "either r or g should be even"; + + m1:=null; m2:= null; m12 := null; + Ul:= null; Ul1:= null; V:= null; + d1 := null; d0:= null; + + d:=g%2; + + -- build up a nondecreasing sequence begin with d, end with d+g, and their sum is an expected degree, and is balanced as possible as it can + targetSum := (r*g)//2 + d*r; + degSeq := apply(r, i-> d + floor(g*i/(r-1))); + delta := targetSum - sum degSeq; + mutSeq := new MutableList from degSeq; + + -- adjust the sequence + searchIndex:=1; -- start from the second element + while (delta > 0) do ( + if (searchIndex >= r-1) then searchIndex=1; + if (mutSeq#searchIndex < mutSeq#(searchIndex+1)) then (mutSeq#searchIndex = mutSeq#searchIndex+1; delta=delta-1; searchIndex=1;) else searchIndex=searchIndex+1; + ); + + degSeq=toList mutSeq; + assert( degSeq#0 == d and degSeq#(r-1) == d+g and (sum degSeq == targetSum)); + + while ( + -- build a vector bundle V as extensions of line bundles of degrees in degSeq + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + + #d1 >=3 or #d0 >=3) do (); + + Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + M1Ul:=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + coker map(S^(r*2^g),,Ulrich) +) + /// restart load "PencilsOfQuadrics.m2" -kk=ZZ/101 +kk=ZZ/nextPrime(10^3) R=kk[s,t] + g=3 (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); M=cliffordModule(Mu1,Mu2,R) -elapsedTime Ulrich = searchUlrich(M,S); -betti res Ulrich -ann Ulrich + +r=4 +time rUlrich=searchUlrich(M,S,r); +minimalBetti rUlrich +time ann rUlrich == ideal( sub(qq,{S_(2*g+2)=>1,S_(2*g+3)=>0}), sub(qq,{S_(2*g+2)=>0,S_(2*g+3)=>1})) + + +g=6; +r=3; -- looking for Ulrich of rank r*2^(g-1) +time (S, qq, R, u, M1, M2, Mu1, Mu2)=randomNicePencil(kk,g); -- when g>4 it becomes heavy! +-- used 461.086 seconds +time M=cliffordModule(Mu1,Mu2,R) +-- used 101.41 seconds + +Mor = vectorBundleOnE M.evenCenter; +Mor1= vectorBundleOnE M.oddCenter; +f = M.hyperellipticBranchEquation; +d=g%2; + + -- build up a nondecreasing sequence begin with d, end with d+g, and their sum is an expected degree, and is balanced as possible as it can + targetSum = (r*g)//2 + d*r; + degSeq = apply(r, i-> d + floor(g*i/(r-1))); + delta = targetSum - sum degSeq; + mutSeq = new MutableList from degSeq; + + -- adjust the sequence + searchIndex=1; -- start from the second element + while (delta > 0) do ( + if (searchIndex >= r-1) then searchIndex=1; + if (mutSeq#searchIndex < mutSeq#(searchIndex+1)) then (mutSeq#searchIndex = mutSeq#searchIndex+1; delta=delta-1; searchIndex=1;) else searchIndex=searchIndex+1; + ); + + degSeq=toList mutSeq + + time tally apply(1, j->( -- number of trials=1 + V=randomLineBundle(degSeq#0,f); + for i from 1 to r-1 do( + m1=randomLineBundle(degSeq#i,f); + m12=randomExtension(m1.yAction,V.yAction); + V=vectorBundleOnE m12; + ); + + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + + (betti Ul.yAction, betti Ul1.yAction) + )) + +-- computing the actions of generators is very heavy, but by this part the computation is promising +-- for instance, (g,r) = (6,3) takes + +-* + -- used 815.548 seconds + + 0 1 0 1 +o915 = Tally{(total: 384 384, total: 384 384) => 1} + -6: 192 . -4: 384 . + -5: 192 . -3: . . + -4: . . -2: . . + -3: . . -1: . . + -2: . . 0: . . + -1: . . 1: . . + 0: . 192 2: . 384 + 1: . 192 + +*- + +-- which is believed to be inducing an Ulrich bundle of rank r*2^(g-2). -assert(4*2^(g-1)== numrows presentation Ulrich) -* M=cliffordModule(Mu1,Mu2,R) @@ -1338,7 +1858,7 @@ ExtIntoK(Ideal, Module) := (I,M) -> ( -- algebra over --a polynomial subring T (eg R = k[s,t][x_0...x_n]/s*q1(x)+t*q2(x)) --and I is an ideal such that T = R/I, - --the script returns + --the scritp returns --Ext^*(M,R/I) --graded in POSITIVE degrees --as a module over T[X_0...X_c] @@ -1415,6 +1935,7 @@ document { }, SUBSECTION "Vector Bundles", UL{ + TO preRandomLineBundle, -- kk has to be finite TO randomLineBundle, -- kk has to be finite TO vectorBundleOnE, TO yAction, @@ -1434,7 +1955,8 @@ document { UL{ TO translateIsotropicSubspace, TO randomIsotropicSubspace, -- kk has to be finite - TO searchUlrich -- kk has to be finite + TO searchUlrich, -- kk has to be finite + TO LabBookProtocol } } @@ -1450,7 +1972,7 @@ doc /// X:Matrix row matrix of linear forms with constant coefficients Y:Matrix - row matrix of linear forms with linear coefficients of same length as X + row matrix of linear forms with linear coefficents of same length as X Outputs M1:Matrix M2:Matrix @@ -1626,11 +2148,11 @@ doc /// The variables of S that are entries of X:= matrix \{\{x_0..y_{(g-1)},z_1,z_2\}\} \, represent coordinates on PP_R^{2g+1}. - M1, M2 are consecutive high syzygy matrices in the minimal (periodic) resolution + M1, M2 are consecutive high syzygy matrices in the miminal (periodic) resolution of kk[s,t] = S/(ideal X) as a module over S/qq. These are used to construct the Clifford algebra of qq. - Mu1, Mu2 are consecutive high syzygy matrices in the minimal (periodic) resolution + Mu1, Mu2 are consecutive high syzygy matrices in the miminal (periodic) resolution of S/(ideal u) as a module over S/qq. These are used to construct a Morita bundle between the even Clifford algebra of qq and the hyperelliptic curve branched over the degeneracy locus of the pencil, @@ -1707,7 +2229,7 @@ doc /// polynomial ring of the form kk[U], where U are parameter variables M1:Matrix - over an auxiliary ring S = kk[X,Y,Z,U] + over an auxilliary ring S = kk[X,Y,Z,U] M2:Matrix M1, M2 a matrix factorization: M1*M2- qq*id = 0 for a quadratic form qq on S Outputs @@ -1726,7 +2248,7 @@ doc /// We have eOdd_i*eEv_j+eOdd_j*eEv_i = B(e_i,e_j), where the e_i form a basis of the space on which qq acts and B is the bilinear form associated to 2qq - thus the pairs (eOd_i,eEv_i) form a representation of Cliff(qq). + thus the the pairs (eOd_i,eEv_i) form a representation of Cliff(qq). --If qq is nonsingular over the generic point of R, then C is an Azumaya algebra over R, and this implies that the representation is faithful. In the following we construct the generic symmetric @@ -2044,7 +2566,7 @@ doc /// polynomial ring kk[s,t] Description Text - The base ring kk[s,t] which is the coordinate ring of PP^1. + The base ring kk[s,t] which is the coordnate ring of PP^1. Example kk=ZZ/101; g=1; @@ -2474,7 +2996,7 @@ doc /// Text A vector bundle on a hyperelliptic curve E with equation y^2 - (-1)^g * f - can be represented by it's pushforward V to PP^1, + can be represeted by it's pushforward V to PP^1, under the degree 2 map, which will be a vector bundle of twice the rank, together with a matrix @@ -2698,14 +3220,14 @@ doc /// doc /// Key - randomLineBundle - (randomLineBundle,RingElement) - (randomLineBundle,ZZ,RingElement) + preRandomLineBundle + (preRandomLineBundle,RingElement) + (preRandomLineBundle,ZZ,RingElement) Headline a random line bundle on the hyperelliptic curve Usage - L=randomLineBundle(f) - Ld=randomLineBundle(d,f) + L=preRandomLineBundle(f) + Ld=preRandomLineBundle(d,f) Inputs f : RingElement the hyperelliptic branch equation of a CliffordModule. @@ -2731,9 +3253,7 @@ doc /// whose determinant equals to (-1)^{g}*f. We find such a matrix over a finite ground field by picking randomly b, a homogeneous form of degree (g+1), since the binary form b^2 + (-1)^{g}*f frequently factors. - - - + Example kk=ZZ/101; g=1; @@ -2741,12 +3261,12 @@ doc /// cM=cliffordModule(rNP.matFact1,rNP.matFact2,rNP.baseRing); f=cM.hyperellipticBranchEquation - L=randomLineBundle(f) + L=preRandomLineBundle(f) degOnE L m=L.yAction (m)^2_(0,0)+(-1)^g*f==0 - L0=randomLineBundle(0,f) + L0=preRandomLineBundle(0,f) degOnE L0 orderInPic L0 @@ -2757,6 +3277,60 @@ doc /// VectorBundleOnE degOnE orderInPic + randomLineBundle +/// + +doc /// + Key + randomLineBundle + (randomLineBundle,RingElement) + (randomLineBundle,ZZ,RingElement) + Headline + a random balanced line bundle on the hyperelliptic curve + Usage + L=randomLineBundle(f) + Ld=randomLineBundle(d,f) + Inputs + f : RingElement + the hyperelliptic branch equation of a CliffordModule. + d : ZZ + Outputs + L : VectorBundleOnE + a line bundle on E + Ld : VectorBundleOnE + a line bundle on E of degree d. + Description + Text + Chooses a random line bundle on the hyperelliptic curve E of genus g + given by the equation y^2-(-1)^{g}*f, where f is the branch equation of degree + (2g+2). Input with an integer d gives a random line bundle of degree d on E. + + Note that the method preRandomLineBundle mostly constructs an unbalanced line bundle, that is, + the degrees of a and c for the determinantal representation of (-1)^{g}*f have a big gap. + Such a line bundle will be contained in the theta divisor (after a certain twist), so we make it into a balanced line bundle + by tensoring degree 0 line bundles. + + + Example + kk=ZZ/1009; + g=2; + rNP=randNicePencil(kk,g); + cM=cliffordModule(rNP.matFact1,rNP.matFact2,rNP.baseRing); + + f=cM.hyperellipticBranchEquation + + tally apply(30, i->(Lp=preRandomLineBundle(1,f); betti Lp.yAction)) + + tally apply(30, i->(L=randomLineBundle(1,f); betti L.yAction)) + + Caveat + The ground field kk has to be finite. + SeeAlso + preRandomLineBundle + vectorBundleOnE + VectorBundleOnE + degOnE + orderInPic /// doc /// @@ -2805,7 +3379,6 @@ doc /// degOnE /// ---YK doc /// Key cliffordModuleToMatrixFactorization @@ -2935,17 +3508,21 @@ doc /// Key searchUlrich (searchUlrich, CliffordModule, Ring) + (searchUlrich, CliffordModule, Ring, ZZ) Headline - searching an Ulrich module of smallest possible rank + searching an Ulrich module of smallest possible rank, or an Ulrich module of given rank. Usage Ulr = searchUlrich(M,S) + Ulr = searchUlrich(M,S,r) Inputs M : CliffordModule S : Ring - a polynomial ring in x_0..y_{(g-1)},z_1,z_2,s,t + a polynomial ring in x_0..y_(g-1),z_1,z_2,s,t + r : ZZ + an integer greater than 1, either g or r is even Outputs Ulr : Module - a module on S supported on x_0..y_{(g-1)},z_1,z_2 + a module on S supported on x_0..y_(g-1),z_1,z_2 Description Text M is assumed to be a Clifford module with a Morita bundle F_u, i.e., associated to a @@ -2962,6 +3539,11 @@ doc /// searchUlrich looks for a candidate G of rank 2 on E and returns a module on S supported on a CI V(q_1,q_2) \subset PP^{2g+1}. + + When r is indicated, searchUlrich looks for a candidate G of rank r on E and returns a module on S + supported on a CI V(q_1,q_2) \subset PP^{2g+1}. + + Example kk=ZZ/101; g=2; @@ -2977,12 +3559,87 @@ doc /// elapsedTime Ulr = searchUlrich(M,S); betti res Ulr ann Ulr == ideal qs + + elapsedTime Ulr3 = searchUlrich(M,S,3); + betti res Ulr3 + ann Ulr3 == ideal qs Caveat - searchUlrich uses the method randomLineBundle, so the ground field kk has to be finite. + searchUlrich uses the method randomLineBundle, so the ground field kk has to be finite. SeeAlso cliffordModule + LabBookProtocol +/// + +doc /// + Key + LabBookProtocol + (LabBookProtocol,ZZ) + (LabBookProtocol,ZZ,ZZ) + Headline + Print commands that lead to a construction of a Ulrich bundle + Usage + S = LabBookProtocol(g) + S = LabBookProtocol(g,r) + Inputs + g:ZZ + genus of the associated hyperelliptic curve E. + r:ZZ + rank of the vextor bundle E + Outputs + S:String + of commands which would produce an Ulrich bundle on X + Description + Text + Our function searchUlrich produces Ulrich bundles of rank r + in principle. However some of the computation take lot of time. + We break this approach for small (g,r) into parts + and protocol the commande and the timings. + Example + g=3 + LabBookProtocol(g) + + g=3 + kk= ZZ/101; + elapsedTime (S,qq,R,u, M1,M2, Mu1, Mu2)=randomNicePencil(kk,g); + -- 0.644455 seconds elapsed + M=cliffordModule(Mu1,Mu2,R) + Mor = vectorBundleOnE M.evenCenter; + Mor1= vectorBundleOnE M.oddCenter; + f = M.hyperellipticBranchEquation; + assert(dim ideal jacobian ideal f ==0); + elapsedTime while ( + m1=randomLineBundle(g+(g%2),f); + m2=randomLineBundle(g%2,f); + m12=randomExtension(m1.yAction,m2.yAction); + V = vectorBundleOnE m12; + Ul=tensorProduct(Mor,V); + Ul1=tensorProduct(Mor1,V); + d0=unique degrees target Ul.yAction; + d1=unique degrees target Ul1.yAction; + #d1 >=3 or #d0 >=3) do (); + -- 0.337555 seconds elapsed + betti Ul.yAction, betti Ul1.yAction + --further commands + elapsedTime Ul = tensorProduct(M,V); -- the heaviest part computing the actions of generators + -- 9.35977 seconds elapsed + M1Ul=sum(#Ul.oddOperators,i->S_i*sub(Ul.oddOperators_i,S)); + r=2 + Ulrich := M1Ul^{r*2^g..(2*r)*2^g-1}; + Ulr=coker map(S^(r*2^g),,Ulrich); + minimalBetti Ulr + -- will give an Ulrich bundle, with betti table + -- 16 32 16 + + (g,r)=(3,4) + LabBookProtocol(g,r) + SeeAlso + searchUlrich + RandomNicePencil + tensorProduct + randomLineBundle /// + doc /// Key translateIsotropicSubspace From b10493f0abfe614c7a0e669e2d9bcb1e1e78c29b Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Fri, 25 Oct 2024 15:03:01 -0700 Subject: [PATCH 179/226] fixed spelling in Pencils.. --- M2/Macaulay2/packages/PencilsOfQuadrics.m2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 index 78b2f1d1b6a..44cce1ab38e 100644 --- a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 +++ b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 @@ -1858,7 +1858,7 @@ ExtIntoK(Ideal, Module) := (I,M) -> ( -- algebra over --a polynomial subring T (eg R = k[s,t][x_0...x_n]/s*q1(x)+t*q2(x)) --and I is an ideal such that T = R/I, - --the scritp returns + --the script returns --Ext^*(M,R/I) --graded in POSITIVE degrees --as a module over T[X_0...X_c] @@ -1972,7 +1972,7 @@ doc /// X:Matrix row matrix of linear forms with constant coefficients Y:Matrix - row matrix of linear forms with linear coefficents of same length as X + row matrix of linear forms with linear coefficients of same length as X Outputs M1:Matrix M2:Matrix @@ -2148,11 +2148,11 @@ doc /// The variables of S that are entries of X:= matrix \{\{x_0..y_{(g-1)},z_1,z_2\}\} \, represent coordinates on PP_R^{2g+1}. - M1, M2 are consecutive high syzygy matrices in the miminal (periodic) resolution + M1, M2 are consecutive high syzygy matrices in the minimal (periodic) resolution of kk[s,t] = S/(ideal X) as a module over S/qq. These are used to construct the Clifford algebra of qq. - Mu1, Mu2 are consecutive high syzygy matrices in the miminal (periodic) resolution + Mu1, Mu2 are consecutive high syzygy matrices in the minimal (periodic) resolution of S/(ideal u) as a module over S/qq. These are used to construct a Morita bundle between the even Clifford algebra of qq and the hyperelliptic curve branched over the degeneracy locus of the pencil, @@ -2229,7 +2229,7 @@ doc /// polynomial ring of the form kk[U], where U are parameter variables M1:Matrix - over an auxilliary ring S = kk[X,Y,Z,U] + over an auxiliary ring S = kk[X,Y,Z,U] M2:Matrix M1, M2 a matrix factorization: M1*M2- qq*id = 0 for a quadratic form qq on S Outputs From 82c56807936dda91b86f9ccae7189b001e15ff19 Mon Sep 17 00:00:00 2001 From: David Eisenbud Date: Sat, 26 Oct 2024 07:36:42 -0700 Subject: [PATCH 180/226] fixed the urls in Pencils.. --- M2/Macaulay2/packages/PencilsOfQuadrics.m2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 index 44cce1ab38e..b60f7e5aff2 100644 --- a/M2/Macaulay2/packages/PencilsOfQuadrics.m2 +++ b/M2/Macaulay2/packages/PencilsOfQuadrics.m2 @@ -17,13 +17,13 @@ peek loadedFiles Date => "October 10, 2024", Authors => {{Name => "Frank-Olaf Schreyer", Email => "schreyer@math.uni-sb.de", - HomePage => ""}, + HomePage => "https://www.math.uni-sb.de/ag/schreyer/index.php/"}, {Name => "David Eisenbud", Email => "de@msri.org", - HomePage => "www.msri.org/~de"}, + HomePage => "https://eisenbud.github.io/"}, {Name => "Yeongrak Kim", Email => "yeongrak.kim@pusan.ac.kr", - HomePage => "sites.google.com/view/yeongrak"} + HomePage => "https://sites.google.com/view/yeongrak"} }, PackageExports => {"CompleteIntersectionResolutions"}, Headline => "Clifford Algebra of a pencil of quadratic forms", From e293afa3dfb5ba0792bdd4a4e0266484d4cbe5bf Mon Sep 17 00:00:00 2001 From: n-m-g Date: Wed, 30 Oct 2024 23:34:24 -0300 Subject: [PATCH 181/226] Update AbstractSimplicialComplexes.m2 Edits to overload == and dim as requested. --- .../packages/AbstractSimplicialComplexes.m2 | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 index 3ad975f525d..e4360a9d641 100644 --- a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 +++ b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 @@ -32,7 +32,7 @@ newPackage( export {"AbstractSimplicialComplex", "abstractSimplicialComplex","simplicialChainComplex", "reducedSimplicialChainComplex", "ambientAbstractSimplicialComplexSize", "ambientAbstractSimplicialComplex", "abstractSimplicialComplexFacets", "randomAbstractSimplicialComplex", "randomSubSimplicialComplex", - "inducedSimplicialChainComplexMap","inducedReducedSimplicialChainComplexMap","areEqual", "dimAbstractSimplicialComplex", + "inducedSimplicialChainComplexMap","inducedReducedSimplicialChainComplexMap" } -* Code section *- @@ -113,19 +113,15 @@ abstractSimplicialComplexFacets(AbstractSimplicialComplex) := List => K ->( --- decide if two simplicial complexes are equal ---- we could overload "==" here but it seems better not to overload too many things that are external to the package - -areEqual = method() - -areEqual(AbstractSimplicialComplex,AbstractSimplicialComplex) := Boolean => (K,L) ->( +AbstractSimplicialComplex == AbstractSimplicialComplex := Boolean => (K,L) ->( return (abstractSimplicialComplexFacets K) == (abstractSimplicialComplexFacets L) ) + --- returns the dimension of a simplicial complex -dimAbstractSimplicialComplex = method() -dimAbstractSimplicialComplex(AbstractSimplicialComplex) := ZZ => (K) -> ( +dim AbstractSimplicialComplex := ZZ => (K) -> ( return (max apply(abstractSimplicialComplexFacets(K), i -> #i) - 1) ) @@ -400,7 +396,7 @@ inducedSimplicialChainComplexMap(AbstractSimplicialComplex,AbstractSimplicialCom ( h := simplicialChainComplex H; l := simplicialChainComplex L; - if areEqual(abstractSimplicialComplex {{}},H)==true then return map(l,h,zero) + if ((abstractSimplicialComplex {{}}) == H)==true then return map(l,h,zero) else( f := hashTable apply(spots h, i -> if i == -1 then i => map(l_(-1),h_(-1),zero) else i => inducedKFaceSimplicialChainComplexMap(i,L,H)); return map(l,h,f); @@ -414,7 +410,7 @@ inducedReducedSimplicialChainComplexMap = method() inducedReducedSimplicialChainComplexMap(AbstractSimplicialComplex,AbstractSimplicialComplex) := (L,H) -> ( h := reducedSimplicialChainComplex H; l := reducedSimplicialChainComplex L; - if areEqual(abstractSimplicialComplex {{}},H)==true then return map(l,h, hashTable {-2 => map(l_(-2),h_(-2),zero), -1 => map(l_(-1),h_(-1),id_(h_(-1)))}) + if ((abstractSimplicialComplex {{}}) == H) == true then return map(l,h, hashTable {-2 => map(l_(-2),h_(-2),zero), -1 => map(l_(-1),h_(-1),id_(h_(-1)))}) else( f := hashTable apply(spots h, i -> if i == -1 then i => map(l_(-1),h_(-1),id_(h_(-1))) else i => inducedKFaceSimplicialChainComplexMap(i,L,H)); return map(l,h,f); @@ -591,15 +587,14 @@ doc /// doc /// Key - areEqual - (areEqual,AbstractSimplicialComplex,AbstractSimplicialComplex) + (symbol ==,AbstractSimplicialComplex,AbstractSimplicialComplex) Headline Decide if two simplicial complexes are equal Description Text Decides if two simplicial complexes are equal. Example - areEqual(randomAbstractSimplicialComplex(4),randomAbstractSimplicialComplex(4)) + randomAbstractSimplicialComplex(4) == randomAbstractSimplicialComplex(4) /// doc /// @@ -609,7 +604,7 @@ doc /// (randomAbstractSimplicialComplex,ZZ,ZZ) (randomAbstractSimplicialComplex,ZZ,ZZ,ZZ) Headline - Create a random simplicial set + Create a random abstract simplicial complex Description Text Create a random abstract simplicial complex with vertices supported on a subset of [n] = {1,...,n}. @@ -829,8 +824,7 @@ doc /// doc /// Key - dimAbstractSimplicialComplex - (dimAbstractSimplicialComplex, AbstractSimplicialComplex) + (dim, AbstractSimplicialComplex) Headline The dimension of a simplicial complex Description @@ -838,7 +832,7 @@ doc /// This method returns the dimension a given AbstractSimplicialComplex. Example K = abstractSimplicialComplex(3) - dimAbstractSimplicialComplex K + dim K /// From 19580a61f56302eef76a5a5c567b38da19310e24 Mon Sep 17 00:00:00 2001 From: n-m-g Date: Thu, 31 Oct 2024 08:17:13 -0300 Subject: [PATCH 182/226] Update AbstractSimplicialComplexes.m2 --- M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 index e4360a9d641..5da3b6e2960 100644 --- a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 +++ b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 @@ -396,7 +396,7 @@ inducedSimplicialChainComplexMap(AbstractSimplicialComplex,AbstractSimplicialCom ( h := simplicialChainComplex H; l := simplicialChainComplex L; - if ((abstractSimplicialComplex {{}}) == H)==true then return map(l,h,zero) + if ((abstractSimplicialComplex {{}}) == H) then return map(l,h,zero) else( f := hashTable apply(spots h, i -> if i == -1 then i => map(l_(-1),h_(-1),zero) else i => inducedKFaceSimplicialChainComplexMap(i,L,H)); return map(l,h,f); @@ -410,7 +410,7 @@ inducedReducedSimplicialChainComplexMap = method() inducedReducedSimplicialChainComplexMap(AbstractSimplicialComplex,AbstractSimplicialComplex) := (L,H) -> ( h := reducedSimplicialChainComplex H; l := reducedSimplicialChainComplex L; - if ((abstractSimplicialComplex {{}}) == H) == true then return map(l,h, hashTable {-2 => map(l_(-2),h_(-2),zero), -1 => map(l_(-1),h_(-1),id_(h_(-1)))}) + if ((abstractSimplicialComplex {{}}) == H) then return map(l,h, hashTable {-2 => map(l_(-2),h_(-2),zero), -1 => map(l_(-1),h_(-1),id_(h_(-1)))}) else( f := hashTable apply(spots h, i -> if i == -1 then i => map(l_(-1),h_(-1),id_(h_(-1))) else i => inducedKFaceSimplicialChainComplexMap(i,L,H)); return map(l,h,f); @@ -604,7 +604,7 @@ doc /// (randomAbstractSimplicialComplex,ZZ,ZZ) (randomAbstractSimplicialComplex,ZZ,ZZ,ZZ) Headline - Create a random abstract simplicial complex + Create a random simplicial set Description Text Create a random abstract simplicial complex with vertices supported on a subset of [n] = {1,...,n}. From e542022abcb8311d3f67fde4dfe6188b3f17c021 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Thu, 31 Oct 2024 00:31:26 +0100 Subject: [PATCH 183/226] fixed slow determinant --- M2/Macaulay2/m2/multilin.m2 | 36 +++++++++++++++----------------- M2/Macaulay2/tests/normal/det.m2 | 25 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/M2/Macaulay2/m2/multilin.m2 b/M2/Macaulay2/m2/multilin.m2 index b14874a534a..6a0b0527de3 100644 --- a/M2/Macaulay2/m2/multilin.m2 +++ b/M2/Macaulay2/m2/multilin.m2 @@ -13,27 +13,25 @@ hasNoQuotients QuotientRing := (R) -> isField R hasNoQuotients PolynomialRing := (R) -> hasNoQuotients coefficientRing R hasNoQuotients Ring := (R) -> true -getMinorsStrategy := (R, opts) -> ( - bareiss := 0; -- WARNING: these must match the engine!! - cofactor := 1; - dynamic := 2; - strat := if opts.?Strategy then opts.Strategy else null; - if strat === global Bareiss then bareiss - else if strat === global Cofactor then cofactor - else if strat === global Dynamic then dynamic - else if strat =!= null then ( - error "'Strategy' keyword must be 'Cofactor', 'Bareiss' or 'Dynamic"; - ) - else ( +hasFreeSupport = (R, m) -> 0 == # intersect(set \\ index \ support m, set \\ index \ support ideal R) + +-- Keep this in sync DET_* strategy codes in Macaulay2/e/det.hpp +RawMinorsStrategyCodes = new HashTable from { + Bareiss => 0, + Cofactor => 1, + Dynamic => 2, + } + +getMinorsStrategy := (R, m, strat) -> RawMinorsStrategyCodes#strat ?? ( + if strat === null then RawMinorsStrategyCodes#( -- Use the Bareiss algorithm unless R is a quotient of -- a polynomial ring. Note that if R is non-commutative -- then either algorithm is incorrect. What is the correct -- thing to do in this case? - if hasNoQuotients R and precision R === infinity then - bareiss - else - cofactor - )) + if precision R < infinity then Cofactor else + if hasNoQuotients R then Bareiss else + if hasFreeSupport(R, m) then Bareiss else Cofactor) + else error "'Strategy' keyword must be 'Cofactor', 'Bareiss' or 'Dynamic") ----------------------------------------------------------------------------- -- symmetricAlgebra @@ -110,7 +108,7 @@ exteriorPower(ZZ, Matrix) := Matrix => opts -> (p, m) -> ( else map( exteriorPower(p, target m, opts), exteriorPower(p, source m, opts), - rawExteriorPower(p, raw m, getMinorsStrategy(R, opts))) + rawExteriorPower(p, raw m, getMinorsStrategy(R, m, opts.Strategy))) ) wedgeProduct = method() @@ -141,7 +139,7 @@ minors(ZZ, Matrix) := Ideal => opts -> (j, m) -> ( ) ) then error "expected a list of 2 lists of integers"; if j <= 0 then ideal 1_(ring m) - else ideal map(ring m, rawMinors(j, raw m, getMinorsStrategy(ring m,opts), + else ideal map(ring m, rawMinors(j, raw m, getMinorsStrategy(ring m, m, opts.Strategy), if opts.Limit === infinity then -1 else opts.Limit, if f =!= null then f#0, if f =!= null then f#1))) diff --git a/M2/Macaulay2/tests/normal/det.m2 b/M2/Macaulay2/tests/normal/det.m2 index 1b8c2c738ca..eeb94b4e4b3 100644 --- a/M2/Macaulay2/tests/normal/det.m2 +++ b/M2/Macaulay2/tests/normal/det.m2 @@ -3,6 +3,31 @@ for K in RINGS do ( M = matrix {{0,1_K},{1,0}}; assert(det M == -1) ) + +-- c.f. https://github.com/Macaulay2/M2/issues/3407 +m = matrix(ZZ/32003[x]/(x), { + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,-2,0,0,-2,0,0,0,0,0,0,1,0,0,0,0,3,0,0}, + {0,0,2,0,0,-1,0,0,0,3,0,0,-1,0,-3,0,0,1,0}, + {0,0,0,-2,0,0,1,1,0,0,3,0,0,0,0,0,0,0,3}, + {0,-1,0,0,3,0,0,0,3,0,0,2,0,3,0,0,3,0,0}, + {0,0,1,0,0,-1,0,0,0,0,0,0,-1,0,1,0,0,-1,0}, + {0,0,0,2,0,0,3,-1,0,0,1,0,0,0,0,3,0,0,1}, + {0,0,0,0,0,0,-1,0,0,0,-1,0,0,0,0,1,0,0,-1}, + {0,-2,0,0,-2,0,0,0,0,0,0,1,0,0,0,0,3,0,0}, + {0,0,3,0,0,2,0,0,0,1,0,0,2,0,-1,0,0,-2,0}, + {0,0,0,2,0,0,3,-1,0,0,1,0,0,0,0,3,0,0,1}, + {0,-1,0,0,-2,0,0,0,1,0,0,1,0,1,0,0,2,0,0}, + {0,0,-1,0,0,0,0,0,0,-3,0,0,0,0,-3,0,0,-2,0}, + {0,0,0,0,2,0,0,0,-2,0,0,-1,0,-2,0,0,-1,0,0}, + {0,0,-2,0,0,-3,0,0,0,-1,0,0,-3,0,2,0,0,1,0}, + {0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,-2,0,0,2}, + {0,2,0,0,-3,0,0,0,-2,0,0,-2,0,-2,0,0,3,0,0}, + {0,0,-3,0,0,-3,0,0,0,3,0,0,-3,0,-1,0,0,-1,0}, + {0,0,0,2,0,0,-2,-1,0,0,3,0,0,0,0,1,0,0,3}}) +(t, d) = toSequence elapsedTiming det m; +assert(t < 0.01 and d == 0) + end restart From dc4a4452e344c6743c202537c1dfe8d666fa340f Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 12:23:01 -0400 Subject: [PATCH 184/226] Skip multiline comments when checking if test/example is capturable --- M2/Macaulay2/m2/examples.m2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/m2/examples.m2 b/M2/Macaulay2/m2/examples.m2 index c38e97eec02..160aa17f94c 100644 --- a/M2/Macaulay2/m2/examples.m2 +++ b/M2/Macaulay2/m2/examples.m2 @@ -130,8 +130,8 @@ isCapturable = (inputs, pkg, isTest) -> ( -- alternatively, no-capture-flag can be used with an example or test if argumentMode & NoCapture =!= 0 or match("no-capture-flag", inputs) then return false; -- strip commented segments first - inputs = replace("--.*$", "", inputs); - inputs = replace("-\\*.*?\\*-", "", inputs); + inputs = replace("--.*$", "", inputs); + inputs = replace("-\\*(.|\n)*?\\*-", "", inputs); -- TODO: remove this when the effects of capture on other packages is reviewed (isTest or match({"FirstPackage", "Macaulay2Doc"}, pkg#"pkgname")) and not match({ From f5095ba23efa6066dff3f8cc89805b5bcc15c68c Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 10:18:35 -0400 Subject: [PATCH 185/226] Remove old atan/atan2 error message Unnecessary since calling "atan(x,y)" will raise a "no method found" error anyway and we'll never reach this code. --- M2/Macaulay2/d/actors3.d | 2 -- 1 file changed, 2 deletions(-) diff --git a/M2/Macaulay2/d/actors3.d b/M2/Macaulay2/d/actors3.d index 4d565db263d..65902ee3d08 100644 --- a/M2/Macaulay2/d/actors3.d +++ b/M2/Macaulay2/d/actors3.d @@ -1060,8 +1060,6 @@ atan(e:Expr):Expr := ( is x:CCcell do toExpr(atan(x.v)) -- # typical value: atan, CC, CC is x:RRcell do toExpr(atan(x.v)) -- # typical value: atan, RR, RR is x:RRicell do toExpr(atan(x.v)) -- # typical value: atan, RRi, RRi - is a:Sequence do if length(a) == 2 then buildErrorPacket("atan(x,y) has been replaced by atan2(y,x)") - else WrongNumArgs(1) else WrongArgRRorCC() ); setupfun("atan",atan).Protected=false; From b4893086f817a92ba0cc47798a56d18588eb0d36 Mon Sep 17 00:00:00 2001 From: Michael Burr Date: Thu, 31 Oct 2024 12:44:56 -0400 Subject: [PATCH 186/226] Removed PrintLevel from tests --- M2/Macaulay2/packages/SubalgebraBases/tests.m2 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/M2/Macaulay2/packages/SubalgebraBases/tests.m2 b/M2/Macaulay2/packages/SubalgebraBases/tests.m2 index fea55c1789a..87a2a4038a2 100644 --- a/M2/Macaulay2/packages/SubalgebraBases/tests.m2 +++ b/M2/Macaulay2/packages/SubalgebraBases/tests.m2 @@ -90,11 +90,11 @@ ans = matrix {{x_11*x_13-x_10*x_14, x_8*x_13-x_7*x_14, x_5*x_13-x_4*x_14, x_2*x_ x_2*x_4*x_6*x_8-x_1*x_5*x_6*x_8-x_2*x_3*x_7*x_8+x_0*x_5*x_7*x_8+x_1*x_3*x_8^2-x_0*x_4*x_8^2, x_0*x_2*x_4*x_6-x_0*x_1*x_5*x_6-x_0*x_2*x_3*x_7+x_0^2*x_5*x_7+x_0*x_1*x_3*x_8-x_0^2*x_4*x_8}}; assert( - time subalgebraBasis(F,Limit=>100,PrintLevel=>1) + time subalgebraBasis(F,Limit=>100) == ans) assert( - time subalgebraBasis(F,Limit=>100,PrintLevel=>1,AutoSubduce=>false) + time subalgebraBasis(F,Limit=>100,AutoSubduce=>false) == ans) /// @@ -306,7 +306,7 @@ ans = matrix {{x, x*y-y^2, x*y^2, x*y^3+50*y^4, x*y^4, x*y^5-34*y^6, x*y^6, x*y^ x*y^17-45*y^18, x*y^18, x*y^19+10*y^20, x*y^20, x*y^21-46*y^22, x*y^22, x*y^23+42*y^24, x*y^24, x*y^25+31*y^26, x*y^26, x*y^27+36*y^28, x*y^28, x*y^29-27*y^30}} assert( - time subalgebraBasis(F,Limit=>30,PrintLevel=>0) + time subalgebraBasis(F,Limit=>30) == ans) /// @@ -520,7 +520,7 @@ R = QQ[x, y, MonomialOrder => Lex] S = subring({x*y - y, x - y^2, y^3}) ans = matrix {{x - y^2, x*y - y, y^3}} assert( - time subalgebraBasis(S,PrintLevel=>0,Limit=>30) + time subalgebraBasis(S,Limit=>30) == ans ) @@ -536,7 +536,7 @@ S = subring({x^2,x*y-y,2*x+y^3,y^4}) ans = matrix {{x+(1/2)*y^3, x*y-y, y^4, x*y^3+(1/4)*y^6, x*y^6+(2/9)*y^9-(1/3)*y^6-(4/9)*y^3, y^6-4*y^3, y^9-8*y^3}} assert( - time subalgebraBasis(S,PrintLevel=>0,Limit=>30) + time subalgebraBasis(S,Limit=>30) == ans ) @@ -549,7 +549,7 @@ R = QQ[x, y]; S = subring({x*y-y,2*x+y^3,y^4}); ans = matrix {{x*y-y, y^3+2*x, y^4, x^4-4*x^3+6*x^2-4*x}} assert( - time subalgebraBasis(S,PrintLevel=>0,Limit=>30) + time subalgebraBasis(S,Limit=>30) == ans ) @@ -563,7 +563,7 @@ S = subring({x^2,x*y-y,2*x+y^3,y^4}) ans = matrix {{x*y-y, x^2, y^3+2*x, y^4, x^4*y-y, x*y^6-4*x*y^3-12*x^3-4*x, x^5-2*x*y^3-4*x^3-x, x*y^3+2*x^3, x^3+x}} assert( - time subalgebraBasis(S,PrintLevel=>0,Limit=>30) + time subalgebraBasis(S,Limit=>30) == ans ) From 98db8722de9e6c9d6268b03f0894368287f94992 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 12:55:50 -0400 Subject: [PATCH 187/226] Preload PackageCitations package --- M2/Macaulay2/m2/packages.m2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/m2/packages.m2 b/M2/Macaulay2/m2/packages.m2 index e036c5172e7..5463c90448a 100644 --- a/M2/Macaulay2/m2/packages.m2 +++ b/M2/Macaulay2/m2/packages.m2 @@ -473,7 +473,8 @@ Core#"preloaded packages" = { "SimpleDoc", "OnlineLookup", "Isomorphism", - "Varieties"} + "Varieties", + "PackageCitations"} protect PackageIsLoaded From 52a95576a456c9293b2b8cdab7e677febbf539b7 Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Thu, 31 Oct 2024 12:45:35 -0400 Subject: [PATCH 188/226] Fixed a crash for zero elements in a NCGB computation, and fixes maps between AssociativeAlgebras and WeylAlgebras. --- M2/Macaulay2/e/M2FreeAlgebra.hpp | 4 ++++ M2/Macaulay2/e/NCAlgebras/FreeAlgebra.cpp | 2 +- M2/Macaulay2/packages/AssociativeAlgebras.m2 | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/e/M2FreeAlgebra.hpp b/M2/Macaulay2/e/M2FreeAlgebra.hpp index 35229b1a78c..c32b7cf6637 100644 --- a/M2/Macaulay2/e/M2FreeAlgebra.hpp +++ b/M2/Macaulay2/e/M2FreeAlgebra.hpp @@ -50,6 +50,8 @@ class M2FreeAlgebraOrQuotient : public Ring virtual const M2FreeAlgebraOrQuotient * cast_to_M2FreeAlgebraOrQuotient() const { return this; } virtual M2FreeAlgebraOrQuotient * cast_to_M2FreeAlgebraOrQuotient() { return this; } + bool is_commutative_ring() const { return false; } + }; class M2FreeAlgebra : public M2FreeAlgebraOrQuotient @@ -166,6 +168,8 @@ class M2FreeAlgebra : public M2FreeAlgebraOrQuotient ring_elem makeTerm(const ring_elem a, const_varpower monom) const; void makeTerm(Poly& result, const ring_elem a, const_varpower monom) const; + + bool is_commutative_ring() const { return false; } }; PolyList copyPolyVector(const M2FreeAlgebraOrQuotient* A, diff --git a/M2/Macaulay2/e/NCAlgebras/FreeAlgebra.cpp b/M2/Macaulay2/e/NCAlgebras/FreeAlgebra.cpp index fc99bc693a1..5f5005ffbc8 100644 --- a/M2/Macaulay2/e/NCAlgebras/FreeAlgebra.cpp +++ b/M2/Macaulay2/e/NCAlgebras/FreeAlgebra.cpp @@ -750,7 +750,7 @@ ring_elem FreeAlgebra::eval(const RingMap *map, for (auto i = f.cbegin(); i != f.cend(); ++i) { vp.clear(); - monoid().getMonomial(i.monom(), vp); + monoid().getMonomialReversed(i.monom(), vp); ring_elem g = map->eval_term(coefficientRing(), i.coeff(), vp.data(), first_var, numVars()); H->add(g); } diff --git a/M2/Macaulay2/packages/AssociativeAlgebras.m2 b/M2/Macaulay2/packages/AssociativeAlgebras.m2 index e55b6d992ba..85fda8d0644 100644 --- a/M2/Macaulay2/packages/AssociativeAlgebras.m2 +++ b/M2/Macaulay2/packages/AssociativeAlgebras.m2 @@ -355,7 +355,7 @@ NCGB(Ideal, ZZ) := opts -> (I, maxdeg) -> ( if I == 0 then return gens I; strat := opts#Strategy; if not I.cache.?NCGB or I.cache.NCGB#0 < maxdeg then ( - tobecomputed := raw if I.cache.?NCGB then I.cache.NCGB#1 else gens I; + tobecomputed := raw if I.cache.?NCGB then I.cache.NCGB#1 else compress gens I; possField := ZZ/(char ultimate(coefficientRing, ring I)); f4Allowed := (possField === (coefficientRing ring I)); -- or instance(coefficientRing ring I, GaloisField) or coefficientRing ring I === QQ; if not isHomogeneous I or (not f4Allowed and (strat == "F4" or strat == "F4Parallel")) then ( From 33d34ffcc7910f30cc71f60c0d00bebff51767ae Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Thu, 31 Oct 2024 13:08:09 -0400 Subject: [PATCH 189/226] Removed a definition of is_commutative_ring() in an inherited class. --- M2/Macaulay2/e/M2FreeAlgebra.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/M2/Macaulay2/e/M2FreeAlgebra.hpp b/M2/Macaulay2/e/M2FreeAlgebra.hpp index c32b7cf6637..fb8f7823a5a 100644 --- a/M2/Macaulay2/e/M2FreeAlgebra.hpp +++ b/M2/Macaulay2/e/M2FreeAlgebra.hpp @@ -168,8 +168,6 @@ class M2FreeAlgebra : public M2FreeAlgebraOrQuotient ring_elem makeTerm(const ring_elem a, const_varpower monom) const; void makeTerm(Poly& result, const ring_elem a, const_varpower monom) const; - - bool is_commutative_ring() const { return false; } }; PolyList copyPolyVector(const M2FreeAlgebraOrQuotient* A, From 876974a2ded43c848f9b921968abeb2a131dbce5 Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Thu, 31 Oct 2024 13:12:23 -0400 Subject: [PATCH 190/226] Added a test to make sure the WeylAlgebras and AssociativeAlgebras ring map work together. --- M2/Macaulay2/tests/normal/ringmap7.m2 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 M2/Macaulay2/tests/normal/ringmap7.m2 diff --git a/M2/Macaulay2/tests/normal/ringmap7.m2 b/M2/Macaulay2/tests/normal/ringmap7.m2 new file mode 100644 index 00000000000..7a085a0d969 --- /dev/null +++ b/M2/Macaulay2/tests/normal/ringmap7.m2 @@ -0,0 +1,21 @@ +restart +needsPackage "WeylAlgebras" +needsPackage "AssociativeAlgebras" + +D = ZZ/101[x,dx, WeylAlgebra => {x => dx}] +R = ZZ/101<|dy,y|>/(dy*y - 1 - y*dy) + +f = map(R, D, {y,dy}) +g = map(D, R, {dx,x}) + +assert(f(dx*x) == y*dy+1) +assert(f(x*dx) == y*dy) + +assert(f(dx*x^2) == y^2*dy+2*y) +assert(f(x^2*dx) == y^2*dy) + +assert(g(dy*y) == x*dx+1) +assert(g(y*dy) == x*dx) + +assert(g(dy*y^2) == x^2*dx+2*x) +assert(g(y^2*dy) == x^2*dx) From 3f2cd9f0562a2ba6d8e050c0c421d8294749f71a Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Thu, 31 Oct 2024 13:51:03 -0400 Subject: [PATCH 191/226] Removed a restart. --- M2/Macaulay2/tests/normal/ringmap7.m2 | 1 - 1 file changed, 1 deletion(-) diff --git a/M2/Macaulay2/tests/normal/ringmap7.m2 b/M2/Macaulay2/tests/normal/ringmap7.m2 index 7a085a0d969..1568bf7ef3d 100644 --- a/M2/Macaulay2/tests/normal/ringmap7.m2 +++ b/M2/Macaulay2/tests/normal/ringmap7.m2 @@ -1,4 +1,3 @@ -restart needsPackage "WeylAlgebras" needsPackage "AssociativeAlgebras" From 201666c2441fcfa262081d7c4f872634f6a81601 Mon Sep 17 00:00:00 2001 From: Frank Moore Date: Thu, 31 Oct 2024 21:33:12 -0400 Subject: [PATCH 192/226] Fixed a test in AssociativeAlgebras and added another test to new ring map test. --- M2/Macaulay2/packages/AssociativeAlgebras/tests.m2 | 5 +++-- M2/Macaulay2/tests/normal/ringmap7.m2 | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/AssociativeAlgebras/tests.m2 b/M2/Macaulay2/packages/AssociativeAlgebras/tests.m2 index 73ca3520cd1..c0949065ebc 100644 --- a/M2/Macaulay2/packages/AssociativeAlgebras/tests.m2 +++ b/M2/Macaulay2/packages/AssociativeAlgebras/tests.m2 @@ -347,8 +347,9 @@ TEST /// assert(G b == s) assert(G 3 == 3) F s - assert(F (s*t) == d*c*b*c) -- Do we want to allow this? F is not well-defined. kind of a BUG!! - + assert(F(s*t) == F(s) * F(t)) -- note that the map F is not well-defined, but + -- M2 still allows such ring maps. + F1 = map(R,R,{c,b,d}) F1 (b*c*d + b*b*d*c*d*b) diff --git a/M2/Macaulay2/tests/normal/ringmap7.m2 b/M2/Macaulay2/tests/normal/ringmap7.m2 index 1568bf7ef3d..09b2485131c 100644 --- a/M2/Macaulay2/tests/normal/ringmap7.m2 +++ b/M2/Macaulay2/tests/normal/ringmap7.m2 @@ -3,9 +3,11 @@ needsPackage "AssociativeAlgebras" D = ZZ/101[x,dx, WeylAlgebra => {x => dx}] R = ZZ/101<|dy,y|>/(dy*y - 1 - y*dy) +S = ZZ/101<|z,dz|>/(dz*z - 1 - z*dz) f = map(R, D, {y,dy}) g = map(D, R, {dx,x}) +h = map(S, R, {dz,z}) assert(f(dx*x) == y*dy+1) assert(f(x*dx) == y*dy) @@ -18,3 +20,10 @@ assert(g(y*dy) == x*dx) assert(g(dy*y^2) == x^2*dx+2*x) assert(g(y^2*dy) == x^2*dx) + +assert(h(dy*y) == z*dz+1) +assert(h(y*dy) == z*dz) + +assert(h(dy*y^2) == z^2*dz+2*z) +assert(h(y^2*dy) == z^2*dz) + From d9b635d82694eb28d0e5fde1347763a36ebdfbe7 Mon Sep 17 00:00:00 2001 From: pzinn Date: Fri, 1 Nov 2024 17:06:30 +1100 Subject: [PATCH 193/226] fix annoying typo in VectorGraphics --- M2/Macaulay2/packages/VectorGraphics.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/VectorGraphics.m2 b/M2/Macaulay2/packages/VectorGraphics.m2 index 6a1f1c32d74..c21877af718 100644 --- a/M2/Macaulay2/packages/VectorGraphics.m2 +++ b/M2/Macaulay2/packages/VectorGraphics.m2 @@ -249,7 +249,7 @@ GraphicsObject ++ List := (opts1, opts2) -> ( if #sty>0 then opts2 = append(opts2,symbol style => merge(opts1.style,sty,last)); x := new class opts1 from select(opts2,o -> class o#0 =!= String); x=merge(opts1,x, - (m,y) -> if instance(m,Matrix) and instance(y,Matrix) then m*y else m -- for TransformMatrix and AnimMatrix + (m,m') -> if instance(m,Matrix) and instance(m',Matrix) then m*m' else m' -- for TransformMatrix and AnimMatrix ); -- almost like cloneall crdlist=new MutableList; grlist=new MutableHashTable; From ddce36a9ed4be65c685018286abd53e8b4ac2f0d Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 24 Oct 2024 23:32:23 -0400 Subject: [PATCH 194/226] Certify SubalgebraBases package --- M2/Macaulay2/packages/SubalgebraBases.m2 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/SubalgebraBases.m2 b/M2/Macaulay2/packages/SubalgebraBases.m2 index 8edbbd7d5bc..7b7c19fac90 100644 --- a/M2/Macaulay2/packages/SubalgebraBases.m2 +++ b/M2/Macaulay2/packages/SubalgebraBases.m2 @@ -30,7 +30,21 @@ newPackage( Headline => "Canonical subalgebra bases (aka SAGBI/Khovanskii bases)", AuxiliaryFiles => true, -- set to true if package comes with auxiliary files DebuggingMode => false, -- set to true only during development - Keywords => {"Commutative Algebra"} + Keywords => {"Commutative Algebra"}, + Certification => { + "journal name" => "Journal of Software for Algebra and Geometry", + "journal URI" => "https://msp.org/jsag/", + "article title" => "SubalgebraBases in Macaulay2", + "acceptance date" => "2024-03-18", + "published article URI" => "https://msp.org/jsag/2024/14-1/p11.xhtml", + "published article DOI" => "10.2140/jsag.2024.14.97", + "published code URI" => "https://msp.org/jsag/2024/14-1/jsag-v14-n1-x11-SAGBIBases.zip", + "repository code URI" => "https://github.com/Macaulay2/M2/blob/master/M2/Macaulay2/packages/SubalgebraBases.m2", + "release at publication" => "97d711d9b7232b6fcf64c0395bd9cb07b8b968c0", + "version at publication" => "1.3", + "volume number" => "14", + "volume URI" => "https://msp.org/jsag/2024/14-1/" + } ) needs "./SubalgebraBases/exports.m2" From b34b1f4aff13e2d382f912395520dda7c7763797 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 25 Oct 2024 06:44:01 -0400 Subject: [PATCH 195/226] Certify SpecialFanoFourfolds package --- M2/Macaulay2/packages/SpecialFanoFourfolds.m2 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/SpecialFanoFourfolds.m2 b/M2/Macaulay2/packages/SpecialFanoFourfolds.m2 index b41e3440dce..fb7c0666226 100644 --- a/M2/Macaulay2/packages/SpecialFanoFourfolds.m2 +++ b/M2/Macaulay2/packages/SpecialFanoFourfolds.m2 @@ -19,7 +19,21 @@ newPackage( PackageImports => {"PrimaryDecomposition"}, PackageExports => {"MultiprojectiveVarieties"}, DebuggingMode => false, - Reload => false + Reload => false, + Certification => { + "journal name" => "Journal of Software for Algebra and Geometry", + "journal URI" => "https://msp.org/jsag/", + "article title" => "The SpecialFanoFourfolds package in Macaulay2", + "acceptance date" => "2024-04-14", + "published article URI" => "https://msp.org/jsag/2024/14-1/p12.xhtml", + "published article DOI" => "10.2140/jsag.2024.14.111", + "published code URI" => "https://msp.org/jsag/2024/14-1/jsag-v14-n1-x12-SpecialFanoFourfolds.m2", + "repository code URI" => "https://github.com/Macaulay2/M2/blob/master/M2/Macaulay2/packages/SpecialFanoFourfolds.m2", + "release at publication" => "67f7b2f777314d7f85c02a661d8e54f9d2c5e8d3", + "version at publication" => "2.7.1", + "volume number" => "14", + "volume URI" => "https://msp.org/jsag/2024/14-1/" + } ) requiredMultiprojectiveVarietiesVersion := "2.7.1"; From 6c4cb23b3520261255b6c8edb64cd9d288ef277d Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 25 Oct 2024 07:19:11 -0400 Subject: [PATCH 196/226] Certify A1BrouwerDegrees package --- M2/Macaulay2/packages/A1BrouwerDegrees.m2 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/A1BrouwerDegrees.m2 b/M2/Macaulay2/packages/A1BrouwerDegrees.m2 index c6df9ab088b..c80ad537434 100644 --- a/M2/Macaulay2/packages/A1BrouwerDegrees.m2 +++ b/M2/Macaulay2/packages/A1BrouwerDegrees.m2 @@ -36,7 +36,21 @@ newPackage ( PackageImports => {}, PackageExports => {}, AuxiliaryFiles => true, - Keywords => {"Homotopy Theory","Commutative Algebra"} + Keywords => {"Homotopy Theory","Commutative Algebra"}, + Certification => { + "journal name" => "Journal of Software for Algebra and Geometry", + "journal URI" => "https://msp.org/jsag/", + "article title" => "$\\mathbb{A}^1$-Brouwer degrees in Macaulay2", + "acceptance date" => "2024-08-07", + "published article URI" => "https://msp.org/jsag/2024/14-1/p15.xhtml", + "published article DOI" => "10.2140/jsag.2024.14.175", + "published code URI" => "https://msp.org/jsag/2024/14-1/jsag-v14-n1-x15-A1BrouwerDegrees.zip", + "repository code URI" => "https://github.com/Macaulay2/M2/blob/master/M2/Macaulay2/packages/A1BrouwerDegrees.m2", + "release at publication" => "98f142fe23304b808c1e931b723b3addff77a643", + "version at publication" => "1.1", + "volume number" => "14", + "volume URI" => "https://msp.org/jsag/2024/14-1/" + } ) export{ From 19a270b9c5875ac90b1fea2df753904a4bc301c5 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 25 Oct 2024 07:30:23 -0400 Subject: [PATCH 197/226] Add certified packages to 1.24.11 changelog --- M2/Macaulay2/packages/Macaulay2Doc/changes.m2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 index 49ca22bec16..9a39ad99ac1 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 @@ -43,6 +43,13 @@ document { document { Key => "changes made for the next release", UL { + LI { "packages that have been published and certified:", + UL { + LI { star, " ", TO "A1BrouwerDegrees::A1BrouwerDegrees", ", a package by Nikita Borisov, Thomas Brazelton, Frenly Espino, Tom Hagedorn, Zhaobo Han, Jordy Lopez Garcia, Joel Louwsma, Wern Juin Gabriel Ong, and Andrew Tawfeek for A1-Brouwer degree computations, has been published." }, + LI { star, " ", TO "SpecialFanoFourfolds::SpecialFanoFourfolds", ", a package by Giovanni Staglianò for Hodge-special fourfolds, has been published." }, + LI { star, " ", TO "SubalgebraBases::SubalgebraBases", ", a package by Michael Burr, Oliver Clarke, Timothy Duff, Jackson Leaman, Nathan Nichols, and Elise Walker for Canonical subalgebra bases (aka SAGBI/Khovanskii bases), has been published." } + } + }, LI { "functionality changed in a way that could break code:", UL { LI { "The function ", TO remove, ", which previously had no return value, now returns the value that was removed." } From 292aeaf9ce4c3457b35b9a3fabef3f6f65f846e9 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 27 Oct 2024 21:40:25 -0400 Subject: [PATCH 198/226] Add --enable-rpm to RHEL docker Makefile for building packages --- M2/BUILD/docker/rhel/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/M2/BUILD/docker/rhel/Makefile b/M2/BUILD/docker/rhel/Makefile index 77c6bec018f..6419f39db51 100644 --- a/M2/BUILD/docker/rhel/Makefile +++ b/M2/BUILD/docker/rhel/Makefile @@ -15,7 +15,8 @@ git config --global --add safe.directory $(M2_HOME)/M2 mkdir -p M2/$(BUILD_DIR) cd M2/$(BUILD_DIR) $(M2_HOME)/M2/M2/autogen.sh -$(M2_HOME)/M2/M2/configure --with-system-gc --enable-download +$(M2_HOME)/M2/M2/configure --with-system-gc --enable-download --enable-rpm \ + --prefix=/usr make endef export M2_BUILD_SCRIPT_autotools From 89829c26250fc30b3c425ff15f978e230edc508c Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 27 Oct 2024 21:40:44 -0400 Subject: [PATCH 199/226] Add Rocky Linux and AlmaLinux to recognized issues (autotools) --- M2/configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/M2/configure.ac b/M2/configure.ac index 26cf9963039..273c60df1f7 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -128,6 +128,8 @@ then if test -f /usr/bin/sw_vers *"openSUSE") ISSUE_FLAVOR=openSUSE ;; "SUSE LINUX") ISSUE_FLAVOR=SuseLinux ;; "arch") ISSUE_FLAVOR=ArchLinux ; ISSUE_RELEASE=none ;; + "rocky") ISSUE_FLAVOR=RockyLinux ;; + "almalinux") ISSUE_FLAVOR=AlmaLinux ;; "") AC_MSG_ERROR([issue not found]) ;; *) AC_MSG_NOTICE([unrecognized issue: $ISSUE_FLAVOR]) ;; esac From ddcd86e0218a592dbc3205d9266efea758878513 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 28 Oct 2024 07:44:47 -0400 Subject: [PATCH 200/226] Install rpm-build in RHEL docker images --- M2/BUILD/docker/rhel/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/M2/BUILD/docker/rhel/Dockerfile b/M2/BUILD/docker/rhel/Dockerfile index 64b8e7733d1..3756b5f435e 100644 --- a/M2/BUILD/docker/rhel/Dockerfile +++ b/M2/BUILD/docker/rhel/Dockerfile @@ -19,6 +19,7 @@ RUN dnf -y install autoconf automake bison boost-devel bzip2 cmake \ diffutils eigen3 flex gc-devel gcc-c++ gcc-gfortran gdbm-devel git \ glpk-devel gmp-devel lapack-devel libffi-devel libtool \ libxml2-devel make mpfr-devel ncurses-devel openblas-devel patch \ - python3-devel readline-devel tbb-devel which xz-devel zlib-devel + python3-devel readline-devel rpm-build tbb-devel which xz-devel \ + zlib-devel WORKDIR /home/macaulay From 2d9b5e9ceabca298f9c707948943424ac4dbd91d Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 17:49:14 -0400 Subject: [PATCH 201/226] Install R in RHEL docker images (for RInterface) --- M2/BUILD/docker/rhel/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/BUILD/docker/rhel/Dockerfile b/M2/BUILD/docker/rhel/Dockerfile index 3756b5f435e..842be4d9e79 100644 --- a/M2/BUILD/docker/rhel/Dockerfile +++ b/M2/BUILD/docker/rhel/Dockerfile @@ -19,7 +19,7 @@ RUN dnf -y install autoconf automake bison boost-devel bzip2 cmake \ diffutils eigen3 flex gc-devel gcc-c++ gcc-gfortran gdbm-devel git \ glpk-devel gmp-devel lapack-devel libffi-devel libtool \ libxml2-devel make mpfr-devel ncurses-devel openblas-devel patch \ - python3-devel readline-devel rpm-build tbb-devel which xz-devel \ + python3-devel R readline-devel rpm-build tbb-devel which xz-devel \ zlib-devel WORKDIR /home/macaulay From 26691cede9624df3a71548c0de5d2e64f219dbb4 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 28 Oct 2024 11:24:51 -0400 Subject: [PATCH 202/226] Add variable to set docker build-args --- M2/BUILD/docker/Makefile | 2 +- M2/BUILD/docker/rhel/Makefile | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/M2/BUILD/docker/Makefile b/M2/BUILD/docker/Makefile index 058ab90cd1c..851527f4883 100644 --- a/M2/BUILD/docker/Makefile +++ b/M2/BUILD/docker/Makefile @@ -20,7 +20,7 @@ clean-ccache: rm -rf $(STORAGE)/.ccache build: build-image -build-image:; docker build --tag $(TAG) . +build-image:; docker build $(BUILD_ARGS) --tag $(TAG) . ############################################################################### # M2 targets diff --git a/M2/BUILD/docker/rhel/Makefile b/M2/BUILD/docker/rhel/Makefile index 6419f39db51..cf984aba99d 100644 --- a/M2/BUILD/docker/rhel/Makefile +++ b/M2/BUILD/docker/rhel/Makefile @@ -4,6 +4,8 @@ include ../Makefile DISTRIBUTION = rockylinux RELEASE = 8 BUILD = autotools +BUILD_ARGS = --build-arg DISTRIBUTION=$(DISTRIBUTION) \ + --build-arg RELEASE=$(RELEASE) TAG = m2-$(BUILD)-$(DISTRIBUTION)-$(RELEASE)-build BUILD_DIR = M2/BUILD/build-docker From d7c16e14a7969b57c7d9890cc687025636c20081 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 28 Oct 2024 11:25:51 -0400 Subject: [PATCH 203/226] Bump docker RHEL release to 9 --- M2/BUILD/docker/rhel/Dockerfile | 2 +- M2/BUILD/docker/rhel/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/M2/BUILD/docker/rhel/Dockerfile b/M2/BUILD/docker/rhel/Dockerfile index 842be4d9e79..79656dc5669 100644 --- a/M2/BUILD/docker/rhel/Dockerfile +++ b/M2/BUILD/docker/rhel/Dockerfile @@ -1,5 +1,5 @@ ARG DISTRIBUTION=rockylinux -ARG RELEASE=8 +ARG RELEASE=9 FROM $DISTRIBUTION:$RELEASE ARG RELEASE diff --git a/M2/BUILD/docker/rhel/Makefile b/M2/BUILD/docker/rhel/Makefile index cf984aba99d..afb15de3338 100644 --- a/M2/BUILD/docker/rhel/Makefile +++ b/M2/BUILD/docker/rhel/Makefile @@ -2,7 +2,7 @@ include ../Makefile ## Parameters DISTRIBUTION = rockylinux -RELEASE = 8 +RELEASE = 9 BUILD = autotools BUILD_ARGS = --build-arg DISTRIBUTION=$(DISTRIBUTION) \ --build-arg RELEASE=$(RELEASE) From d2dfcc8612f41b216fe17556f1a48dbda750f108 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 28 Oct 2024 16:48:14 -0400 Subject: [PATCH 204/226] Add RHEL docker README --- M2/BUILD/docker/README.md | 1 + M2/BUILD/docker/rhel/README.md | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 M2/BUILD/docker/rhel/README.md diff --git a/M2/BUILD/docker/README.md b/M2/BUILD/docker/README.md index 225d29489a1..bb5a97579a2 100644 --- a/M2/BUILD/docker/README.md +++ b/M2/BUILD/docker/README.md @@ -7,6 +7,7 @@ The `Dockerfile` in this directory creates a container image based on latest Ubu - [`ubuntu`](ubuntu): Compiling Macaulay2 in a Container - [`debian`](debian): Packaging Macaulay2 for Debian (.deb) - [`fedora`](fedora): Packaging Macaulay2 for Fedora (.rpm) +- [`rhel`](rhel): Packaging Macaulay2 for Red Hat Enterprise Linux (.rpm) - [`testbot`](testbot): Macaulay2 testbot for GitHub Actions - [`brew`](brew): Bottling Macaulay2 for [Homebrew](https://brew.sh/) - [`nightly`](nightly): Testing the Nightly Build of Macaulay2 diff --git a/M2/BUILD/docker/rhel/README.md b/M2/BUILD/docker/rhel/README.md new file mode 100644 index 00000000000..9bb468a1af1 --- /dev/null +++ b/M2/BUILD/docker/rhel/README.md @@ -0,0 +1,20 @@ +# Compiling Macaulay2 in a Red Hat Enterprise Linux-compatible Container + +The `Dockerfile` in this directory creates a container image based a Red Hat Enterprise Linux-compatible distribution (either Rocky Linux or AlmaLInux) with all the required libraries and software for compiling Macaulay2. + +## Getting Started +0. Install Docker and start the daemon. + +1. Compile Macaulay2 in a container: +``` +make build +``` + +After the build is complete, rpm packages will be available in `M2/BUILD/build-docker`. + +2. Run Macaulay2: +``` +make run +``` + +By default, the above targets are run on Rocky Linux 9. To switch to AlmaLinux, add `DISTRIBUTION=almalinux`. To switch to an RHEL 8-compatible release, add `RELEASE=8`. From 56ce80bbf6e9edd8bec10d10286adffb78b7c8cc Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 30 Oct 2024 10:11:37 -0400 Subject: [PATCH 205/226] Update Keywords for AbstractSimplicialComplexes package Should match existing keywords for other packages --- M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 index 5da3b6e2960..bef32c6042b 100644 --- a/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 +++ b/M2/Macaulay2/packages/AbstractSimplicialComplexes.m2 @@ -27,7 +27,7 @@ newPackage( DebuggingMode => false, PackageImports => {"Complexes"}, PackageExports => {"Complexes"}, - Keywords => {"Simplicial complexes", "Simplicial chain complexes", "Random simplicial complexes"} + Keywords => {"Combinatorial Commutative Algebra"} ) export {"AbstractSimplicialComplex", "abstractSimplicialComplex","simplicialChainComplex", "reducedSimplicialChainComplex", "ambientAbstractSimplicialComplexSize", From 73d58d7580d551d576fb22ccc444dc2f94c107c4 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 08:52:59 -0400 Subject: [PATCH 206/226] Move new/certified package helper code from README The code is now available as an unexported method in Macaulay2Doc --- M2/Macaulay2/packages/Macaulay2Doc/README | 20 ---------------- M2/Macaulay2/packages/Macaulay2Doc/changes.m2 | 23 +++++++++++++++++++ 2 files changed, 23 insertions(+), 20 deletions(-) delete mode 100644 M2/Macaulay2/packages/Macaulay2Doc/README diff --git a/M2/Macaulay2/packages/Macaulay2Doc/README b/M2/Macaulay2/packages/Macaulay2Doc/README deleted file mode 100644 index a3a9ca22ae9..00000000000 --- a/M2/Macaulay2/packages/Macaulay2Doc/README +++ /dev/null @@ -1,20 +0,0 @@ -some helper code: - -x = {"PruneComplex", "CohomCalg", "Topcom", "ReflexivePolytopesDB", "AbstractToricVarieties", "TestIdeals", "AlgebraicSplines", "TriangularSets", "Chordal", "Tropical", "SymbolicPowers", "Complexes", "GroebnerWalk", "RandomMonomialIdeals", "Matroids", "NumericalImplicitization"} -y = for i in x list needsPackage i -getName = x -> (new OptionTable from x).Name -commaAnd = x -> concatenate ( - if #x > 2 then (between (", ", drop(x, -1)), ", and ", x#-1) - else between (" and ", x)) -for i in y do ( - << /// LI { TO "/// - << i - << ///::/// - << i - << ///", ", a package by /// - << commaAnd (for a in (options i).Authors list getName a) - << /// for /// - << (options i).Headline - << ///, has been added." },/// - << endl - ) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 index 9a39ad99ac1..f7084a1d670 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 @@ -40,6 +40,29 @@ document { } } +-- helper code for listing new/certified packages +-- single new package: changesHelper "NewPackage" +-- multiple new packages: changesHelper {"NewPackage1", "NewPackage2"} +-- certified package: changesHelper("NewPackage", Certification => true) + +changesHelper := method(Options => {Certification => false}) +changesHelper String := opt -> pkgname -> changesHelper({pkgname}, opt) +changesHelper List := opt -> pkgnames -> ( + getName := x -> (new OptionTable from x).Name; + commaAnd := x -> concatenate ( + if #x > 2 then (between (", ", drop(x, -1)), ", and ", x#-1) + else between (" and ", x)); + scan(pkgnames, pkgname -> ( + pkg := needsPackage pkgname; + << "LI { " + << (if opt.Certification then "star, \" \", " else "") + << "TO \"" << pkgname << "::" << pkgname << "\", \", a package by " + << commaAnd apply((options pkg).Authors, getName) + << " for " << (options pkg).Headline << ", has been " + << (if opt.Certification then "published" else "added") + << ".\" }," + << endl))) + document { Key => "changes made for the next release", UL { From e05f4f3eb107ffe1e154d75866772be8ea3a3eb9 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 20:21:13 -0400 Subject: [PATCH 207/226] Bump VERSION to 1.24.11 --- M2/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/VERSION b/M2/VERSION index 4494e70704d..d6c68ad2d09 100644 --- a/M2/VERSION +++ b/M2/VERSION @@ -1 +1 @@ -1.24.05 +1.24.11 From 91ea17151b72e4ea0e1f0d6c7bc41c9760c3f6bd Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 20:45:57 -0400 Subject: [PATCH 208/226] Add rule for gzipping M2-symbols.el (autotools) --- M2/Macaulay2/editors/Makefile.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/M2/Macaulay2/editors/Makefile.in b/M2/Macaulay2/editors/Makefile.in index a09cc7fc729..1a7ba38d65c 100644 --- a/M2/Macaulay2/editors/Makefile.in +++ b/M2/Macaulay2/editors/Makefile.in @@ -20,6 +20,9 @@ emacs/M2-symbols.el prism/macaulay2.js highlightjs/macaulay2.js: \ emacs/M2-emacs.m2 emacs/M2-emacs-help.txt: emacs/make-M2-emacs-help.m2 @pre_exec_prefix@/bin/M2@EXE@ @pre_exec_prefix@/bin/M2 cd emacs; @pre_exec_prefix@/bin/M2 $(ARGS) @abs_srcdir@/emacs/make-M2-emacs-help.m2 -e 'exit 0' +emacs/M2-symbols.el.gz: emacs/M2-symbols.el + gzip -nf9 $< + # copy files to build directory for out-of-tree builds ifneq (@srcdir@,.) emacs prism highlightjs: From 33109facbfd21c846b35772f9a3f9ae2764381b8 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 20:46:13 -0400 Subject: [PATCH 209/226] Update M2-emacs commit w/ 1.24.11 symbols --- M2/Macaulay2/editors/emacs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/editors/emacs b/M2/Macaulay2/editors/emacs index b71ec9f2798..830ef641cea 160000 --- a/M2/Macaulay2/editors/emacs +++ b/M2/Macaulay2/editors/emacs @@ -1 +1 @@ -Subproject commit b71ec9f2798e29f89e539aee41fa0637e190e286 +Subproject commit 830ef641ceaab0c7f847d7399ed735d2da8975e4 From f7fe58310f7ead4e679db8314c6443a37468bbea Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 20:50:52 -0400 Subject: [PATCH 210/226] Update vim symbols for 1.24.11 --- M2/Macaulay2/editors/vim/m2.vim.dict | 4 ++-- M2/Macaulay2/editors/vim/m2.vim.syntax | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/M2/Macaulay2/editors/vim/m2.vim.dict b/M2/Macaulay2/editors/vim/m2.vim.dict index 5dd37304a8b..caf80e56575 100644 --- a/M2/Macaulay2/editors/vim/m2.vim.dict +++ b/M2/Macaulay2/editors/vim/m2.vim.dict @@ -1,6 +1,6 @@ -"" Auto-generated for Macaulay2-1.24.05. Do not modify this file manually. +"" Auto-generated for Macaulay2-1.24.11. Do not modify this file manually. " Vim dictionary file " Language: Macaulay2 -A1BrouwerDegrees about abs AbstractToricVarieties accumulate Acknowledgement acos acosh acot acoth addCancelTask addDependencyTask addEndFunction addHook AdditionalPaths addStartFunction addStartTask Adjacent adjoint AdjointIdeal AdjunctionForSurfaces AffineVariety AfterEval AfterNoPrint AfterPrint agm AInfinity alarm AlgebraicSplines Algorithm Alignment all AllCodimensions allowableThreads ambient analyticSpread Analyzer AnalyzeSheafOnP1 ancestor ancestors ANCHOR and andP AngleBarList ann annihilator antipode any append applicationDirectory applicationDirectorySuffix apply applyKeys applyPairs applyTable applyValues apropos argument Array arXiv Ascending ascii asin asinh ass assert associatedGradedRing associatedPrimes AssociativeAlgebras AssociativeExpression atan atan2 atanh atEndOfFile AtomicInt Authors autoload AuxiliaryFiles backtrace Bag Bareiss Base baseFilename BaseFunction baseName baseRing baseRings BaseRow BasicList basis BasisElementLimit Bayer BeforePrint beginDocumentation BeginningMacaulay2 Benchmark benchmark BernsteinSato Bertini BesselJ BesselY Beta betti BettiCharacters BettiTally between BGG BIBasis Binary BinaryOperation Binomial binomial BinomialEdgeIdeals Binomials BKZ blockMatrixForm BLOCKQUOTE BODY Body BoijSoederberg BOLD Book3264Examples Boolean BooleanGB borel Boxes BR break Browse Bruns BUTTON cache CacheExampleOutput CacheFunction CacheTable cacheValue CallLimit cancelTask canonicalBundle capture CatalanConstant catch Caveat CC CDATA ceiling CellularResolutions Center centerString Certification ChainComplex chainComplex ChainComplexExtras ChainComplexMap ChainComplexOperations changeBase ChangeMatrix char CharacteristicClasses characters charAnalyzer check checkDegrees CheckDocumentation chi Chordal class Classic clean clearAll clearEcho clearOutput close closeIn closeOut ClosestFit CODE code codim CodimensionLimit CodingTheory coefficient CoefficientRing coefficientRing coefficients Cofactor CohenEngine CohenTopLevel CoherentSheaf CohomCalg cohomology coimage CoincidentRootLoci coker cokernel collectGarbage columnAdd columnate columnMult columnPermute columnRankProfile columnSwap combine Command commandInterpreter commandLine COMMENT commonest commonRing comodule compactMatrixForm compareExchange CompiledFunction CompiledFunctionBody CompiledFunctionClosure Complement complement complete CompleteIntersection CompleteIntersectionResolutions Complexes ComplexField components compose compositions compress concatenate conductor ConductorElement cone Configuration ConformalBlocks conjugate connectionCount Consequences Constant Constants constParser content continue contract Contributors ConvexInterface conwayPolynomial ConwayPolynomials copy copyDirectory copyFile copyright Core CorrespondenceScrolls cos cosh cot CotangentSchubert cotangentSheaf coth cover coverMap cpuTime createTask Cremona csc csch current currentColumnNumber currentDirectory currentFileDirectory currentFileName currentLayout currentPackage currentPosition currentRowNumber currentString currentTime Cyclotomic Database Date DD dd deadParser debug debugError DebuggingMode debuggingMode debugLevel DecomposableSparseSystems Decompose decompose deepSplice Default default defaultPrecision Degree degree DegreeGroup degreeGroup degreeLength DegreeLift DegreeLimit DegreeMap DegreeOrder DegreeRank Degrees degrees degreesMonoid degreesRing delete demark denominator Dense Density Depth depth Descending Descent Describe describe Description det determinant DeterminantalRepresentations DGAlgebras diagonalMatrix diameter Dictionary dictionary dictionaryPath diff DiffAlg difference Digamma dim DirectSum directSum disassemble discriminant dismiss Dispatch distinguished DIV Divide divideByVariable DivideConquer DividedPowers Divisor DL Dmodules do doc docExample docTemplate document DocumentTag Down drop DT dual Dynamic eagonNorthcott EagonResolution echoOff echoOn EdgeIdeals edit EigenSolver eigenvalues eigenvectors eint EisenbudHunekeVasconcelos elapsedTime elapsedTiming elements Eliminate eliminate Elimination EliminationMatrices EllipticCurves EllipticIntegrals else EM Email End end endl endPackage Engine engineDebugLevel EngineRing EngineTests entries EnumerationCurves environment Equation EquivariantGB erase erf erfc error errorDepth euler EulerConstant eulers even EXAMPLE ExampleFiles ExampleItem examples ExampleSystems exchange Exclude exec exit exp expectedReesIdeal expm1 exponents export exportFrom exportMutable Expression expression Ext extend ExteriorIdeals ExteriorModules exteriorPower factor false Fano FastMinors FastNonminimal FGLM File fileDictionaries fileExecutable fileExists fileExitHooks fileLength fileMode FileName FilePosition fileReadable fileTime fileWritable fillMatrix findFiles findHeft FindOne findProgram findSynonyms FiniteFittingIdeals First first firstkey FirstPackage fittingIdeal flagLookup FlatMonoid flatten flattenRing Flexible flip floor flush fold FollowLinks for forceGB ForeignFunctions fork FormalGroupLaws Format format formation FourierMotzkin FourTiTwo fpLLL frac fraction FractionField frames FrobeniusThresholds from fromDividedPowers fromDual Function FunctionApplication FunctionBody functionBody FunctionClosure FunctionFieldDesingularization futureParser GaloisField Gamma gb GBDegrees gbRemove gbSnapshot gbTrace gcd gcdCoefficients gcdLLL GCstats genera GeneralOrderedMonoid GenerateAssertions generateAssertions generator generators Generic GenericInitialIdeal genericMatrix genericSkewMatrix genericSymmetricMatrix gens genus GeometricDecomposability get getc getChangeMatrix getenv getGlobalSymbol getIOThreadMode getNetFile getNonUnit getPrimeWithRootOfUnity getSymbol getWWW GF gfanInterface Givens GKMVarieties GLex Global global globalAssign globalAssignFunction GlobalAssignHook globalAssignment globalAssignmentHooks GlobalDictionary GlobalHookStore globalReleaseFunction GlobalReleaseHook GlobalSectionLimit Gorenstein GradedLieAlgebras GradedModule gradedModule GradedModuleMap gradedModuleMap gramm GraphicalModels GraphicalModelsMLE Graphics graphIdeal graphRing Graphs Grassmannian GRevLex GroebnerBasis groebnerBasis GroebnerBasisOptions GroebnerStrata GroebnerWalk groupID GroupLex GroupRevLex GTZ Hadamard handleInterrupts HardDegreeLimit hash HashTable hashTable HEAD HEADER1 HEADER2 HEADER3 HEADER4 HEADER5 HEADER6 HeaderType Heading Headline Heft heft Height height help Hermite hermite Hermitian HH hh HigherCIOperators HighestWeights Hilbert hilbertFunction hilbertPolynomial hilbertSeries HodgeIntegrals hold Holder HolonomicSystems Hom homeDirectory HomePage Homogeneous Homogeneous2 homogenize homology homomorphism HomotopyLieAlgebra hooks horizontalJoin HorizontalSpace HR HREF HTML html httpHeaders Hybrid HyperplaneArrangements Hypertext hypertext HypertextContainer HypertextParagraph HypertextVoid icFracP icFractions icMap icPIdeal id Ideal ideal idealizer identity if IgnoreExampleErrors ii image imaginaryPart IMG ImmutableType importFrom in incomparable Increment INDENT independentSets indeterminate IndeterminateNumber Index index indexComponents IndexedVariable IndexedVariableTable indices inducedMap inducesWellDefinedMap InexactField InexactFieldFamily InexactNumber InfiniteNumber infinity info InfoDirSection infoHelp Inhomogeneous INPUT input Inputs insert installAssignmentMethod installedPackages installHilbertFunction installMethod installMinprimes installPackage InstallPrefix instance instances IntegralClosure integralClosure integrate IntermediateMarkUpType interpreterDepth intersect intersectInP Intersection intersection interval InvariantRing inverse inverseErf InverseMethod inversePermutation inverseRegularizedBeta inverseRegularizedGamma Inverses inverseSystem InverseSystems Invertible InvolutiveBases irreducibleCharacteristicSeries irreducibleDecomposition isAffineRing isANumber isBorel isc isCanceled isCommutative isConstant isDirectory isDirectSum isEmpty isField isFinite isFinitePrimeField isFreeModule isGlobalSymbol isHomogeneous isIdeal isInfinite isInjective isInputFile isIsomorphic isIsomorphism isLiftable isLinearType isListener isLLL isMember isModule isMonomialIdeal isMutable isNormal Isomorphism isOpen isOutputFile isPolynomialRing isPrimary isPrime isPrimitive isProjective isPseudoprime isQuotientModule isQuotientOf isQuotientRing isReady isReal isReduction isRegularFile isRing isSkewCommutative isSorted isSquareFree isStandardGradedPolynomialRing isSubmodule isSubquotient isSubset isSupportedInZeroLocus isSurjective isTable isUnit isWellDefined isWeylAlgebra ITALIC Iterate Iterator iterator Jacobian jacobian jacobianDual Jets Join join JSON Jupyter K3Carpets K3Surfaces KBD Keep KeepFiles KeepZeroes ker kernel kernelLLL kernelOfLocalization Key keys Keyword Keywords kill koszul Kronecker KustinMiller LABEL last lastMatch LATER LatticePolytopes Layout lcm leadCoefficient leadComponent leadMonomial leadTerm Left left length LengthLimit letterParser Lex LexIdeals LI Licenses LieTypes lift liftable Limit limitFiles limitProcesses Linear LinearAlgebra LinearTruncations lineNumber lines LINK linkFile List list listForm listLocalSymbols listSymbols listUserSymbols LITERAL LLL LLLBases lngamma load loadDepth LoadDocumentation loadedFiles loadedPackages loadPackage Local local localDictionaries LocalDictionary localize LocalRings locate log log1p LongPolynomial lookup lookupCount LowerBound LUdecomposition M0nbar M2CODE Macaulay2Doc makeDirectory MakeDocumentation makeDocumentTag MakeHTML MakeInfo MakeLinks makePackageIndex MakePDF makeS2 Manipulator map MapExpression MapleInterface markedGB Markov MarkUpType match MatchingFields mathML Matrix matrix MatrixExpression MatrixSchubert Matroids max maxAllowableThreads maxExponent MaximalRank maxPosition MaxReductionCount MCMApproximations member memoize memoizeClear memoizeValues MENU merge mergePairs MergeTeX META method MethodFunction MethodFunctionBinary MethodFunctionSingle MethodFunctionWithOptions methodOptions methods midpoint min minExponent mingens mingle minimalBetti MinimalGenerators MinimalMatrix minimalPresentation minimalPresentationMap minimalPresentationMapInv MinimalPrimes minimalPrimes minimalReduction Minimize minimize minimizeFilename MinimumVersion minors minPosition minPres minprimes Minus minus Miura MixedMultiplicity mkdir mod Module module ModuleDeformations modulo MonodromySolver Monoid monoid MonoidElement Monomial MonomialAlgebras monomialCurveIdeal MonomialIdeal monomialIdeal MonomialIntegerPrograms MonomialOrbits MonomialOrder Monomials monomials MonomialSize monomialSubideal moveFile multidegree multidoc multigraded MultigradedBettiTally MultigradedBGG MultiGradedRationalMap multiplicity MultiplicitySequence MultiplierIdeals MultiplierIdealsDim2 MultiprojectiveVarieties mutable MutableHashTable mutableIdentity MutableList MutableMatrix mutableMatrix NAGtypes Name nanosleep Nauty NautyGraphs NCAlgebra NCLex needs needsPackage Net net NetFile netList new newClass newCoordinateSystem NewFromMethod newline NewMethod newNetFile NewOfFromMethod NewOfMethod newPackage newRing next nextkey nextPrime nil NNParser NoetherianOperators NoetherNormalization NonminimalComplexes nonspaceAnalyzer NoPrint norm normalCone Normaliz NormalToricVarieties not Nothing notify notImplemented NTL null nullaryMethods nullhomotopy nullParser nullSpace Number number NumberedVerticalList numcols numColumns numerator numeric NumericalAlgebraicGeometry NumericalCertification NumericalImplicitization NumericalLinearAlgebra NumericalSchubertCalculus numericInterval NumericSolutions numgens numRows numrows numTBBThreads odd oeis of ofClass OIGroebnerBases OL OldPolyhedra OldToricVectorBundles on OneExpression OnlineLookup OO oo ooo oooo openDatabase openDatabaseOut openFiles openIn openInOut openListener OpenMath openOut openOutAppend operatorAttributes Option OptionalComponentsPresent optionalSignParser Options options OptionTable optP or Order order OrderedMonoid orP OutputDictionary Outputs override pack Package package PackageCitations PackageDictionary PackageExports PackageImports PackageTemplate packageTemplate pad pager PairLimit pairs PairsRemaining PARA parallelApply ParallelF4 ParallelizeByDegree Parametrization parent Parenthesize Parser Parsing part Partition partition partitions parts path pdim peek PencilsOfQuadrics Permanents permanents permutations pfaffians PHCpack PhylogeneticTrees pi PieriMaps pivots PlaneCurveLinearSeries PlaneCurveSingularities plus poincare poincareN Points polarize poly Polyhedra Polymake PolynomialRing PolyominoIdeals Posets Position position positions PositivityToricBundles POSIX Postfix Power power powermod PRE Precision precision Prefix prefixDirectory prefixPath preimage prepend presentation pretty primaryComponent PrimaryDecomposition primaryDecomposition PrimaryTag PrimitiveElement Print print printerr printingAccuracy printingLeadLimit printingPrecision printingSeparator printingTimeLimit printingTrailLimit printString printWidth Probability processID Product product ProductOrder profile profileSummary Program programPaths ProgramRun Proj Projective ProjectiveHilbertPolynomial projectiveHilbertPolynomial ProjectiveVariety promote protect Prune prune PruneComplex pruningMap Pseudocode pseudocode PseudomonomialPrimaryDecomposition pseudoRemainder Pullback pullback pullbackMaps PushForward pushForward pushout pushoutMaps Python QQ QQParser QRDecomposition QthPower QuadraticIdealExamplesByRoos Quasidegrees QuaternaryQuartics QuillenSuslin quit Quotient quotient quotientRemainder QuotientRing Radical radical RadicalCodim1 radicalContainment RaiseError random RandomCanonicalCurves RandomComplexes RandomCurves RandomCurvesOverVerySmallFiniteFields RandomGenus14Curves RandomIdeals randomKRationalPoint RandomMonomialIdeals randomMutableMatrix RandomObjects RandomPlaneCurves RandomPoints RandomSpaceCurves Range rank RationalMaps RationalPoints RationalPoints2 rays ReactionNetworks read readDirectory readlink readPackage RealField RealFP realPart realpath RealQP RealQP1 RealRoots RealRR RealXD recursionDepth recursionLimit Reduce reducedRowEchelonForm reduceHilbert reductionNumber ReesAlgebra reesAlgebra reesAlgebraIdeal reesIdeal References ReflexivePolytopesDB regex regexQuote registerFinalizer regSeqInIdeal Regularity regularity regularizedBeta regularizedGamma relations RelativeCanonicalResolution relativizeFilename Reload remainder RemakeAllDocumentation remove removeDirectory removeFile removeLowestDimension reorganize replace RerunExamples res reshape ResidualIntersections ResLengthThree Resolution resolution ResolutionsOfStanleyReisnerRings restart Result resultant Resultants return returnCode Reverse reverse RevLex Right right Ring ring RingElement RingFamily ringFromFractions RingMap RInterface rootPath roots rootURI rotate round rowAdd RowExpression rowMult rowPermute rowRankProfile rowSwap RR RRi rsort run RunDirectory RunExamples RunExternalM2 runHooks runLengthEncode runProgram SagbiGbDetection same SAMP saturate Saturation SaturationMap scan scanKeys scanLines scanPairs scanValues schedule schreyerOrder Schubert Schubert2 SchurComplexes SchurFunctors SchurRings SchurVeronese SCRIPT scriptCommandLine ScriptedFunctor SCSCP searchPath sec sech SectionRing SeeAlso seeParsing SegreClasses select selectInSubring selectVariables SelfInitializingType SemidefiniteProgramming Seminormalization separate SeparateExec separateRegexp Sequence sequence Serialization serialNumber Set set setEcho setGroupID setIOExclusive setIOSynchronized setIOUnSynchronized setRandomSeed setup setupEmacs sheaf SheafExpression sheafExt sheafHom SheafMap sheafMap SheafOfRings shield ShimoyamaYokoyama show showClassStructure showHtml showStructure showTex showUserStructure SimpleDoc simpleDocFrob SimplicialComplexes SimplicialDecomposability SimplicialPosets SimplifyFractions sin singularLocus sinh size size2 SizeLimit SkewCommutative SlackIdeals sleep SLnEquivariantMatrices SLPexpressions SMALL smithNormalForm solve someTerms Sort sort sortColumns SortStrategy source SourceCode SourceRing SPACE SpaceCurves SPAN span SparseMonomialVectorExpression SparseResultants SparseVectorExpression Spec SpechtModule SpecialFanoFourfolds specialFiber specialFiberIdeal SpectralSequences splice splitWWW sqrt SRdeformations stack stacksProject Standard standardForm standardPairs StartWithOneMinor stashValue StatePolytope StatGraphs status stderr stdio step StopBeforeComputation stopIfError StopIteration StopWithMinimalGenerators store Strategy Strict String STRONG StronglyStableIdeals STYLE Style style SUB sub SubalgebraBases sublists submatrix submatrixByDegrees Subnodes subquotient SubringLimit Subscript subscript SUBSECTION subsets substitute substring subtable Sugarless Sum sum SumOfTwists SumsOfSquares SUP super SuperLinearAlgebra Superscript superscript support SVD SVDComplexes switch SwitchingFields sylvesterMatrix Symbol symbol SymbolBody symbolBody SymbolicPowers symlinkDirectory symlinkFile symmetricAlgebra symmetricAlgebraIdeal symmetricKernel SymmetricPolynomials symmetricPower synonym SYNOPSIS syz Syzygies SyzygyLimit SyzygyMatrix SyzygyRows syzygyScheme TABLE Table table take Tally tally tan TangentCone tangentCone tangentSheaf tanh target Task taskResult TateOnProducts TD temporaryFileName tensor tensorAssociativity TensorComplexes TensorProduct terminalParser terms TerraciniLoci TEST Test testExample testHunekeQuestion TestIdeals TestInput tests TEX tex TeXmacs texMath Text TH then Thing ThinSincereQuivers ThreadedGB threadLocal threadVariable Threshold throw Time time times timing TITLE TO to TO2 toAbsolutePath toCC toDividedPowers toDual toExternalString toField TOH toList toLower top topCoefficients Topcom topComponents topLevelMode Tor TorAlgebra Toric ToricInvariants ToricTopology ToricVectorBundles toRR toRRi Torsion TorsionFree toSequence toString TotalPairs toUpper TR trace transpose TriangularSets Triangulations Tries Trim trim Triplets Tropical TropicalToric true Truncate truncate truncateOutput Truncations try TSpreadIdeals TT tutorial Type TypicalValue typicalValues UL ultimate unbag uncurry Undo undocumented uniform uninstallAllPackages uninstallPackage union Unique unique uniquePermutations Units Unmixed unsequence unstack Up UpdateOnly UpperTriangular URL urlEncode Usage use UseCachedExampleOutput UseHilbertFunction UserMode userSymbols UseSyzygies utf8 utf8check utf8substring validate Valuations value values VAR Variable VariableBaseName Variables Varieties Variety variety vars Vasconcelos Vector vector VectorExpression VectorFields VectorGraphics Verbose Verbosity Verify VersalDeformations versalEmbedding Version version VerticalList VerticalSpace viewHelp VirtualResolutions VirtualTally VisibleList Visualize VNumber wait WebApp wedgeProduct weightRange Weights WeylAlgebra WeylAlgebras WeylGroups when whichGm while WhitneyStratifications width wikipedia Wrap wrap WrapperType XML xor youngest zero ZeroExpression zeta ZZ ZZParser \ No newline at end of file +A1BrouwerDegrees AInfinity ANCHOR AbstractSimplicialComplexes AbstractToricVarieties Acknowledgement AdditionalPaths Adjacent AdjointIdeal AdjunctionForSurfaces AffineVariety AfterEval AfterNoPrint AfterPrint AlgebraicSplines Algorithm Alignment AllCodimensions AnalyzeSheafOnP1 Analyzer AngleBarList Array Ascending AssociativeAlgebras AssociativeExpression AtomicInt Authors AuxiliaryFiles BGG BIBasis BKZ BLOCKQUOTE BODY BOLD BR BUTTON Bag Bareiss Base BaseFunction BaseRow BasicList BasisElementLimit Bayer BeforePrint BeginningMacaulay2 Benchmark BernsteinSato Bertini BesselJ BesselY Beta BettiCharacters BettiTally Binary BinaryOperation Binomial BinomialEdgeIdeals Binomials Body BoijSoederberg Book3264Examples Boolean BooleanGB Boxes Browse Bruns CC CDATA CODE COMMENT CacheExampleOutput CacheFunction CacheTable CallLimit CatalanConstant Caveat CellularResolutions Center Certification ChainComplex ChainComplexExtras ChainComplexMap ChainComplexOperations ChangeMatrix CharacteristicClasses CheckDocumentation Chordal Classic ClosestFit CodimensionLimit CodingTheory CoefficientRing Cofactor CohenEngine CohenTopLevel CoherentSheaf CohomCalg CoincidentRootLoci Command CompiledFunction CompiledFunctionBody CompiledFunctionClosure Complement CompleteIntersection CompleteIntersectionResolutions ComplexField Complexes ConductorElement Configuration ConformalBlocks Consequences Constant Constants Contributors ConvexInterface ConwayPolynomials Core CorrespondenceScrolls CotangentSchubert Cremona Cyclotomic DD DGAlgebras DIV DL DT Database Date DebuggingMode DecomposableSparseSystems Decompose Default Degree DegreeGroup DegreeLift DegreeLimit DegreeMap DegreeOrder DegreeRank Degrees Dense Density Depth Descending Descent Describe Description DeterminantalRepresentations Dictionary DiffAlg Digamma DirectSum Dispatch Divide DivideConquer DividedPowers Divisor Dmodules DocumentTag Down Dynamic EM EXAMPLE EagonResolution EdgeIdeals EigenSolver EisenbudHunekeVasconcelos Eliminate Elimination EliminationMatrices EllipticCurves EllipticIntegrals Email End Engine EngineRing EngineTests EnumerationCurves Equation EquivariantGB EulerConstant ExampleFiles ExampleItem ExampleSystems Exclude Expression Ext ExteriorIdeals ExteriorModules FGLM Fano FastMinors FastNonminimal File FileName FilePosition FindOne FiniteFittingIdeals First FirstPackage FlatMonoid Flexible FollowLinks ForeignFunctions FormalGroupLaws Format FourTiTwo FourierMotzkin FractionField FrobeniusThresholds Function FunctionApplication FunctionBody FunctionClosure FunctionFieldDesingularization GBDegrees GCstats GF GKMVarieties GLex GRevLex GTZ GaloisField Gamma GeneralOrderedMonoid GenerateAssertions Generic GenericInitialIdeal GeometricDecomposability Givens Global GlobalAssignHook GlobalDictionary GlobalHookStore GlobalReleaseHook GlobalSectionLimit Gorenstein GradedLieAlgebras GradedModule GradedModuleMap GraphicalModels GraphicalModelsMLE Graphics Graphs Grassmannian GroebnerBasis GroebnerBasisOptions GroebnerStrata GroebnerWalk GroupLex GroupRevLex HEAD HEADER1 HEADER2 HEADER3 HEADER4 HEADER5 HEADER6 HH HR HREF HTML Hadamard HardDegreeLimit HashTable HeaderType Heading Headline Heft Height Hermite Hermitian HigherCIOperators HighestWeights Hilbert HodgeIntegrals Holder HolonomicSystems Hom HomePage Homogeneous Homogeneous2 HomotopyLieAlgebra HorizontalSpace Hybrid HyperplaneArrangements Hypertext HypertextContainer HypertextParagraph HypertextVoid IMG INDENT INPUT ITALIC Ideal IgnoreExampleErrors ImmutableType Increment IndeterminateNumber Index IndexedVariable IndexedVariableTable InexactField InexactFieldFamily InexactNumber InfiniteNumber InfoDirSection Inhomogeneous Inputs InstallPrefix IntegralClosure IntermediateMarkUpType Intersection InvariantRing InverseMethod InverseSystems Inverses Invertible InvolutiveBases Isomorphism Iterate Iterator JSON Jacobian Jets Join Jupyter K3Carpets K3Surfaces KBD Keep KeepFiles KeepZeroes Key Keyword Keywords Kronecker KustinMiller LABEL LATER LI LINK LITERAL LLL LLLBases LUdecomposition LatticePolytopes Layout Left LengthLimit Lex LexIdeals Licenses LieTypes Limit Linear LinearAlgebra LinearTruncations List LoadDocumentation Local LocalDictionary LocalRings LongPolynomial LowerBound M0nbar M2CODE MCMApproximations MENU META Macaulay2Doc Maintainer MakeDocumentation MakeHTML MakeInfo MakeLinks MakePDF Manipulator MapExpression MapleInterface MarkUpType Markov MatchingFields Matrix MatrixExpression MatrixSchubert Matroids MaxReductionCount MaximalRank MergeTeX MethodFunction MethodFunctionBinary MethodFunctionSingle MethodFunctionWithOptions MinimalGenerators MinimalMatrix MinimalPrimes Minimize MinimumVersion Minus Miura MixedMultiplicity Module ModuleDeformations MonodromySolver Monoid MonoidElement Monomial MonomialAlgebras MonomialIdeal MonomialIntegerPrograms MonomialOrbits MonomialOrder MonomialSize Monomials Msolve MultiGradedRationalMap MultigradedBGG MultigradedBettiTally MultigradedImplicitization MultiplicitySequence MultiplierIdeals MultiplierIdealsDim2 MultiprojectiveVarieties MutableHashTable MutableList MutableMatrix NAGtypes NCAlgebra NCLex NNParser NTL Name Nauty NautyGraphs Net NetFile NewFromMethod NewMethod NewOfFromMethod NewOfMethod NoPrint NoetherNormalization NoetherianOperators NonminimalComplexes NormalToricVarieties Normaliz Nothing Number NumberedVerticalList NumericSolutions NumericalAlgebraicGeometry NumericalCertification NumericalImplicitization NumericalLinearAlgebra NumericalSchubertCalculus NumericalSemigroups OIGroebnerBases OL OO OldPolyhedra OldToricVectorBundles OneExpression OnlineLookup OpenMath Option OptionTable OptionalComponentsPresent Options Order OrderedMonoid OutputDictionary Outputs PARA PHCpack POSIX PRE Package PackageCitations PackageDictionary PackageExports PackageImports PackageTemplate PairLimit PairsRemaining ParallelF4 ParallelizeByDegree Parametrization Parenthesize Parser Parsing Partition PencilsOfQuadrics Permanents Permutations PhylogeneticTrees PieriMaps PlaneCurveLinearSeries PlaneCurveSingularities Points Polyhedra Polymake PolynomialRing PolyominoIdeals Posets Position PositivityToricBundles Postfix Power Precision Prefix PrimaryDecomposition PrimaryTag PrimitiveElement Print Probability Product ProductOrder Program ProgramRun Proj Projective ProjectiveHilbertPolynomial ProjectiveVariety Prune PruneComplex Pseudocode PseudocodeClosure PseudomonomialPrimaryDecomposition Pullback PushForward Python QQ QQParser QRDecomposition QthPower QuadraticIdealExamplesByRoos Quasidegrees QuaternaryQuartics QuillenSuslin Quotient QuotientRing RInterface RR RRi Radical RadicalCodim1 RaiseError RandomCanonicalCurves RandomComplexes RandomCurves RandomCurvesOverVerySmallFiniteFields RandomGenus14Curves RandomIdeals RandomMonomialIdeals RandomObjects RandomPlaneCurves RandomPoints RandomSpaceCurves Range RationalMaps RationalPoints RationalPoints2 ReactionNetworks RealFP RealField RealQP RealQP1 RealRR RealRoots RealXD Reduce ReesAlgebra References ReflexivePolytopesDB Regularity RelativeCanonicalResolution Reload RemakeAllDocumentation RerunExamples ResLengthThree ResidualIntersections Resolution ResolutionsOfStanleyReisnerRings Result Resultants RevLex Reverse Right Ring RingElement RingFamily RingMap RowExpression RunDirectory RunExamples RunExternalM2 SAMP SCMAlgebras SCRIPT SCSCP SLPexpressions SLnEquivariantMatrices SMALL SPACE SPAN SRdeformations STRONG STYLE SUB SUBSECTION SUP SVD SVDComplexes SYNOPSIS SagbiGbDetection Saturation SaturationMap Schubert Schubert2 SchurComplexes SchurFunctors SchurRings SchurVeronese ScriptedFunctor SectionRing SeeAlso SegreClasses SelfInitializingType SemidefiniteProgramming Seminormalization SeparateExec Sequence Serialization Set SheafExpression SheafMap SheafOfRings ShimoyamaYokoyama SimpleDoc SimplicialComplexes SimplicialDecomposability SimplicialPosets SimplifyFractions SizeLimit SkewCommutative SlackIdeals Sort SortStrategy SourceCode SourceRing SpaceCurves SparseMonomialVectorExpression SparseResultants SparseVectorExpression Spec SpechtModule SpecialFanoFourfolds SpectralSequences Standard StartWithOneMinor StatGraphs StatePolytope StopBeforeComputation StopIteration StopWithMinimalGenerators Strategy Strict String StronglyStableIdeals Style SubalgebraBases Subnodes SubringLimit Subscript Sugarless Sum SumOfTwists SumsOfSquares SuperLinearAlgebra Superscript SwitchingFields Symbol SymbolBody SymbolicPowers SymmetricPolynomials Syzygies SyzygyLimit SyzygyMatrix SyzygyRows TABLE TD TEST TEX TH TITLE TO TO2 TOH TR TSpreadIdeals TT Table Tally TangentCone Task TateOnProducts TeXmacs TensorComplexes TensorProduct TerraciniLoci Test TestIdeals TestInput Text ThinSincereQuivers Thing ThreadedGB Threads Threshold Time Topcom Tor TorAlgebra Toric ToricInvariants ToricTopology ToricVectorBundles Torsion TorsionFree TotalPairs TriangularSets Triangulations Tries Trim Triplets Tropical TropicalToric Truncate Truncations Type TypicalValue UL URL Undo Unique Units Unmixed Up UpdateOnly UpperTriangular Usage UseCachedExampleOutput UseHilbertFunction UseSyzygies UserMode VAR VNumber Valuations Variable VariableBaseName Variables Varieties Variety Vasconcelos Vector VectorExpression VectorFields VectorGraphics Verbose Verbosity Verify VersalDeformations Version VerticalList VerticalSpace VirtualResolutions VirtualTally VisibleList Visualize WebApp Weights WeylAlgebra WeylAlgebras WeylGroups WhitneyStratifications Wrap WrapperType XML ZZ ZZParser ZeroExpression about abs accumulate acos acosh acot acoth addCancelTask addDependencyTask addEndFunction addHook addStartTask adjoint agm alarm all allowableThreads ambient analyticSpread ancestor ancestors and andP ann annihilator antipode any append applicationDirectory applicationDirectorySuffix apply applyKeys applyPairs applyTable applyValues apropos arXiv argument ascii asin asinh ass assert associatedGradedRing associatedPrimes atEndOfFile atan atan2 atanh autoload backtrace baseFilename baseName baseRing baseRings basis beginDocumentation benchmark betti between binomial blockMatrixForm borel break cache cacheValue cancelTask canonicalBundle capture catch ceiling centerString chainComplex changeBase changeDirectory char charAnalyzer characters check checkDegrees chi cite class clean clearAll clearEcho clearOutput close closeIn closeOut code codim coefficient coefficientRing coefficients cohomology coimage coker cokernel collectGarbage columnAdd columnMult columnPermute columnRankProfile columnSwap columnate combine commandInterpreter commandLine commonRing commonest comodule compactMatrixForm compareExchange complement complete components compose compositions compress concatenate conductor cone conjugate connectionCount constParser content continue contract conwayPolynomial copy copyDirectory copyFile copyright cos cosh cot cotangentSheaf coth cover coverMap cpuTime createTask csc csch current currentColumnNumber currentDirectory currentFileDirectory currentFileName currentLayout currentPackage currentPosition currentRowNumber currentString currentTime dd deadParser debug debugError debugLevel debuggingMode decompose deepSplice default defaultPrecision degree degreeGroup degreeLength degrees degreesMonoid degreesRing delete demark denominator depth describe det determinant diagonalMatrix diameter dictionary dictionaryPath diff difference dim directSum disassemble discriminant dismiss distinguished divideByVariable do doc docExample docTemplate document drop dual eagonNorthcott echoOff echoOn edit eigenvalues eigenvectors eint elapsedTime elapsedTiming elements eliminate else end endPackage endl engineDebugLevel entries environment erase erf erfc error errorDepth euler eulers even examples exchange exec exit exp expectedReesIdeal expm1 exponents export exportFrom exportMutable expression extend exteriorPower factor false fileDictionaries fileExecutable fileExists fileExitHooks fileLength fileMode fileReadable fileTime fileWritable fillMatrix findFiles findHeft findProgram findSynonyms first firstkey fittingIdeal flagLookup flatten flattenRing flip floor flush fold for forceGB fork format formation fpLLL frac fraction frames from fromDividedPowers fromDual functionBody futureParser gb gbRemove gbSnapshot gbTrace gcd gcdCoefficients gcdLLL genera generateAssertions generator generators genericMatrix genericSkewMatrix genericSymmetricMatrix gens genus get getChangeMatrix getGlobalSymbol getIOThreadMode getNetFile getNonUnit getPrimeWithRootOfUnity getSymbol getWWW getc getenv gfanInterface global globalAssign globalAssignFunction globalAssignment globalAssignmentHooks globalReleaseFunction gradedModule gradedModuleMap gramm graphIdeal graphRing groebnerBasis groupID handleInterrupts hash hashTable headlines heft height help hermite hh hilbertFunction hilbertPolynomial hilbertSeries hold homeDirectory homogenize homology homomorphism hooks horizontalJoin html httpHeaders hypertext icFracP icFractions icMap icPIdeal id ideal idealizer identity if ii image imaginaryPart importFrom in incomparable independentSets indeterminate index indexComponents indices inducedMap inducesWellDefinedMap infinity info infoHelp input insert installAssignmentMethod installHilbertFunction installMethod installMinprimes installPackage installedPackages instance instances integralClosure integrate interpreterDepth intersect intersectInP intersection interval inverse inverseErf inversePermutation inverseRegularizedBeta inverseRegularizedGamma inverseSystem irreducibleCharacteristicSeries irreducibleDecomposition isANumber isAffineRing isBorel isCanceled isCommutative isConstant isDirectSum isDirectory isEmpty isField isFinite isFinitePrimeField isFreeModule isGlobalSymbol isHomogeneous isIdeal isInfinite isInjective isInputFile isIsomorphic isIsomorphism isLLL isLiftable isLinearType isListener isMember isModule isMonomialIdeal isMutable isNormal isOpen isOutputFile isPolynomialRing isPrimary isPrime isPrimitive isProjective isPseudoprime isQuotientModule isQuotientOf isQuotientRing isReady isReal isReduction isRegularFile isRing isSkewCommutative isSmooth isSorted isSquareFree isStandardGradedPolynomialRing isSubmodule isSubquotient isSubset isSupportedInZeroLocus isSurjective isTable isUnit isVeryAmple isWellDefined isWeylAlgebra isc iterator jacobian jacobianDual join ker kernel kernelLLL kernelOfLocalization keys kill koszul last lastMatch lcm leadCoefficient leadComponent leadMonomial leadTerm left length letterParser lift liftable limitFiles limitProcesses lineNumber lines linkFile list listForm listLocalSymbols listSymbols listUserSymbols lngamma load loadDepth loadPackage loadedFiles loadedPackages local localDictionaries localize locate log log1p lookup lookupCount makeDirectory makeDocumentTag makePackageIndex makeS2 map markedGB match mathML matrix max maxAllowableThreads maxExponent maxPosition member memoize memoizeClear memoizeValues merge mergePairs method methodOptions methods midpoint min minExponent minPosition minPres mingens mingle minimalBetti minimalPresentation minimalPresentationMap minimalPresentationMapInv minimalPrimes minimalReduction minimize minimizeFilename minors minprimes minus mkdir mod module modulo monoid monomialCurveIdeal monomialIdeal monomialSubideal monomials moveFile multidegree multidoc multigraded multiplicity mutable mutableIdentity mutableMatrix nanosleep needs needsPackage net netList new newClass newCoordinateSystem newNetFile newPackage newRing newline next nextPrime nextkey nil nonspaceAnalyzer norm normalCone not notImplemented notify null nullParser nullSpace nullaryMethods nullhomotopy numColumns numRows numTBBThreads number numcols numerator numeric numericInterval numgens numrows odd oeis of ofClass on oo ooo oooo openDatabase openDatabaseOut openFiles openIn openInOut openListener openOut openOutAppend operatorAttributes optP optionalSignParser options or orP order override pack package packageTemplate pad pager pairs parallelApply parent part partition partitions parts path pdim peek permanents permutations pfaffians pi pivots plus poincare poincareN polarize poly position positions power powermod precision prefixDirectory prefixPath preimage prepend presentation pretty primaryComponent primaryDecomposition print printString printWidth printerr printingAccuracy printingLeadLimit printingPrecision printingSeparator printingTimeLimit printingTrailLimit processID product profile profileSummary programPaths projectiveHilbertPolynomial promote protect prune pruningMap pseudoRemainder pseudocode pullback pullbackMaps pushForward pushout pushoutMaps quit quotient quotientRemainder radical radicalContainment random randomKRationalPoint randomMutableMatrix rank rays read readDirectory readPackage readlink realPart realpath recursionDepth recursionLimit reduceHilbert reducedRowEchelonForm reductionNumber reesAlgebra reesAlgebraIdeal reesIdeal regSeqInIdeal regex regexQuote registerFinalizer regularity regularizedBeta regularizedGamma relations relativizeFilename remainder remove removeDirectory removeFile removeLowestDimension reorganize replace res reshape resolution restart resultant return returnCode reverse right ring ringFromFractions rootPath rootURI roots rotate round rowAdd rowMult rowPermute rowRankProfile rowSwap rsort run runHooks runLengthEncode runProgram same saturate scan scanKeys scanLines scanPairs scanValues schedule schreyerOrder scriptCommandLine searchPath sec sech seeParsing select selectInSubring selectKeys selectPairs selectValues selectVariables separate separateRegexp sequence serialNumber set setEcho setGroupID setIOExclusive setIOSynchronized setIOUnSynchronized setRandomSeed setup setupEmacs setupLift setupPromote sheaf sheafExt sheafHom sheafMap shield show showClassStructure showHtml showStructure showTex showUserStructure simpleDocFrob sin singularLocus sinh size size2 sleep smithNormalForm solve someTerms sort sortColumns source span specialFiber specialFiberIdeal splice splitWWW sqrt stack stacksProject standardForm standardPairs stashValue status stderr stdio step stopIfError store style sub sublists submatrix submatrixByDegrees subquotient subscript subsets substitute substring subtable sum super superscript support switch sylvesterMatrix symbol symbolBody symlinkDirectory symlinkFile symmetricAlgebra symmetricAlgebraIdeal symmetricKernel symmetricPower synonym syz syzygyScheme table take tally tan tangentCone tangentSheaf tanh target taskResult temporaryFileName tensor tensorAssociativity terminalParser terms testExample testHunekeQuestion tests tex texMath then threadLocal threadVariable throw time times timing to toAbsolutePath toCC toDividedPowers toDual toExternalString toField toList toLower toRR toRRi toSequence toString toUpper top topCoefficients topComponents topLevelMode trace transpose trim true truncate truncateOutput try tutorial typicalValues ultimate unbag uncurry undocumented uniform uninstallAllPackages uninstallPackage union unique uniquePermutations unsequence unstack urlEncode use userSymbols utf8 utf8check utf8substring validate value values variety vars vector versalEmbedding version viewHelp wait wedgeProduct weightRange when whichGm while width wikipedia wrap xor youngest zero zeta \ No newline at end of file diff --git a/M2/Macaulay2/editors/vim/m2.vim.syntax b/M2/Macaulay2/editors/vim/m2.vim.syntax index fca0927e663..7b3f451fe42 100644 --- a/M2/Macaulay2/editors/vim/m2.vim.syntax +++ b/M2/Macaulay2/editors/vim/m2.vim.syntax @@ -1,4 +1,4 @@ -"" Auto-generated for Macaulay2-1.24.05. Do not modify this file manually. +"" Auto-generated for Macaulay2-1.24.11. Do not modify this file manually. " Vim syntax file " Language: Macaulay2 @@ -18,19 +18,19 @@ syn case match syn keyword m2Boolean true false syn keyword m2Keyword contained - \ and break catch continue do elapsedTime elapsedTiming else for from global if in list local new not of or return shield SPACE step symbol then threadLocal threadVariable throw time timing to try when while xor + \ SPACE TEST and break catch continue do elapsedTime elapsedTiming else for from global if in list local new not of or return shield step symbol then threadLocal threadVariable throw time timing to try when while xor syn keyword m2Datatype contained - \ Adjacent AffineVariety Analyzer ANCHOR AngleBarList Array AssociativeExpression AtomicInt Bag BasicList BettiTally BinaryOperation BLOCKQUOTE BODY BOLD Boolean BR BUTTON CacheFunction CacheTable CC CDATA ChainComplex ChainComplexMap CODE CoherentSheaf Command COMMENT CompiledFunction CompiledFunctionBody CompiledFunctionClosure ComplexField Constant Database DD Descent Describe Dictionary DirectSum DIV Divide DL DocumentTag DT Eliminate EM EngineRing Equation ExampleItem Expression File FilePosition FractionField Function FunctionApplication FunctionBody FunctionClosure GaloisField GeneralOrderedMonoid GlobalDictionary GradedModule GradedModuleMap GroebnerBasis GroebnerBasisOptions HashTable HEAD HEADER1 HEADER2 HEADER3 HEADER4 HEADER5 HEADER6 HeaderType Holder HR HREF HTML Hybrid Hypertext HypertextContainer HypertextParagraph HypertextVoid Ideal IMG ImmutableType INDENT IndeterminateNumber IndexedVariable IndexedVariableTable InexactField InexactFieldFamily InexactNumber InfiniteNumber INPUT IntermediateMarkUpType ITALIC Iterator KBD Keyword LABEL LATER LI LINK List LITERAL LocalDictionary LowerBound Manipulator MapExpression MarkUpType Matrix MatrixExpression MENU META MethodFunction MethodFunctionBinary MethodFunctionSingle MethodFunctionWithOptions Minus Module Monoid MonoidElement MonomialIdeal MultigradedBettiTally MutableHashTable MutableList MutableMatrix Net NetFile Nothing Number NumberedVerticalList OL OneExpression Option OptionTable OrderedMonoid Package PARA Parenthesize Parser Partition PolynomialRing Power PRE Product ProductOrder Program ProgramRun ProjectiveHilbertPolynomial ProjectiveVariety Pseudocode QQ QuotientRing RealField Resolution Ring RingElement RingFamily RingMap RowExpression RR RRi SAMP SCRIPT ScriptedFunctor SelfInitializingType Sequence Set SheafExpression SheafMap SheafOfRings SMALL SPAN SparseMonomialVectorExpression SparseVectorExpression String STRONG STYLE SUB Subscript SUBSECTION Sum SumOfTwists SUP Superscript Symbol SymbolBody TABLE Table Tally Task TD TensorProduct TestInput TEX TH Thing Time TITLE TO TO2 TOH TR TT Type UL URL VAR Variety Vector VectorExpression VerticalList VirtualTally VisibleList WrapperType ZeroExpression ZZ + \ ANCHOR Adjacent AffineVariety Analyzer AngleBarList Array AssociativeExpression AtomicInt BLOCKQUOTE BODY BOLD BR BUTTON Bag BasicList BettiTally BinaryOperation Boolean CC CDATA CODE COMMENT CacheFunction CacheTable ChainComplex ChainComplexMap CoherentSheaf Command CompiledFunction CompiledFunctionBody CompiledFunctionClosure ComplexField Constant DD DIV DL DT Database Descent Describe Dictionary DirectSum Divide DocumentTag EM Eliminate EngineRing Equation ExampleItem Expression File FilePosition FractionField Function FunctionApplication FunctionBody FunctionClosure GaloisField GeneralOrderedMonoid GlobalDictionary GradedModule GradedModuleMap GroebnerBasis GroebnerBasisOptions HEAD HEADER1 HEADER2 HEADER3 HEADER4 HEADER5 HEADER6 HR HREF HTML HashTable HeaderType Holder Hybrid Hypertext HypertextContainer HypertextParagraph HypertextVoid IMG INDENT INPUT ITALIC Ideal ImmutableType IndeterminateNumber IndexedVariable IndexedVariableTable InexactField InexactFieldFamily InexactNumber InfiniteNumber IntermediateMarkUpType Iterator KBD Keyword LABEL LATER LI LINK LITERAL List LocalDictionary LowerBound MENU META Manipulator MapExpression MarkUpType Matrix MatrixExpression MethodFunction MethodFunctionBinary MethodFunctionSingle MethodFunctionWithOptions Minus Module Monoid MonoidElement MonomialIdeal MultigradedBettiTally MutableHashTable MutableList MutableMatrix Net NetFile Nothing Number NumberedVerticalList OL OneExpression Option OptionTable OrderedMonoid PARA PRE Package Parenthesize Parser Partition PolynomialRing Power Product ProductOrder Program ProgramRun ProjectiveHilbertPolynomial ProjectiveVariety Pseudocode PseudocodeClosure QQ QuotientRing RR RRi RealField Resolution Ring RingElement RingFamily RingMap RowExpression SAMP SCRIPT SMALL SPAN STRONG STYLE SUB SUBSECTION SUP ScriptedFunctor SelfInitializingType Sequence Set SheafExpression SheafMap SheafOfRings SparseMonomialVectorExpression SparseVectorExpression String Subscript Sum SumOfTwists Superscript Symbol SymbolBody TABLE TD TEX TH TITLE TO TO2 TOH TR TT Table Tally Task TensorProduct TestInput Thing Time Type UL URL VAR Variety Vector VectorExpression VerticalList VirtualTally VisibleList WrapperType ZZ ZeroExpression syn keyword m2Function container - \ about abs accumulate acos acosh acot acoth addCancelTask addDependencyTask addEndFunction addHook addStartFunction addStartTask adjoint agm alarm all ambient analyticSpread ancestor ancestors andP ann annihilator antipode any append applicationDirectory apply applyKeys applyPairs applyTable applyValues apropos arXiv ascii asin asinh ass assert associatedGradedRing associatedPrimes atan atan2 atanh atEndOfFile autoload baseFilename baseName baseRing basis beginDocumentation benchmark BesselJ BesselY Beta betti between binomial borel cacheValue cancelTask canonicalBundle capture ceiling centerString chainComplex changeBase char characters charAnalyzer check checkDegrees chi class clean clearEcho code codim coefficient coefficientRing coefficients cohomology coimage coker cokernel collectGarbage columnAdd columnate columnMult columnPermute columnRankProfile columnSwap combine commandInterpreter commonest commonRing comodule compareExchange complement complete components compose compositions compress concatenate conductor cone conjugate connectionCount constParser content contract conwayPolynomial copy copyDirectory copyFile cos cosh cot cotangentSheaf coth cover coverMap cpuTime createTask csc csch currentColumnNumber currentDirectory currentPosition currentRowNumber currentTime deadParser debug debugError decompose deepSplice default degree degreeGroup degreeLength degrees degreesMonoid degreesRing delete demark denominator depth describe det determinant diagonalMatrix diameter dictionary diff difference Digamma dim directSum disassemble discriminant dismiss distinguished divideByVariable doc document drop dual eagonNorthcott echoOff echoOn eigenvalues eigenvectors eint elements eliminate End endPackage entries erase erf erfc error euler eulers even EXAMPLE examples exchange exec exp expectedReesIdeal expm1 exponents export exportFrom exportMutable expression extend exteriorPower factor Fano fileExecutable fileExists fileLength fileMode fileReadable fileTime fileWritable fillMatrix findFiles findHeft findProgram findSynonyms first firstkey fittingIdeal flagLookup flatten flattenRing flip floor fold forceGB fork format formation frac fraction frames fromDividedPowers fromDual functionBody futureParser Gamma gb gbRemove gbSnapshot gcd gcdCoefficients gcdLLL GCstats genera generateAssertions generator generators genericMatrix genericSkewMatrix genericSymmetricMatrix gens genus get getc getChangeMatrix getenv getGlobalSymbol getIOThreadMode getNetFile getNonUnit getPrimeWithRootOfUnity getSymbol getWWW GF globalAssign globalAssignFunction globalAssignment globalReleaseFunction gradedModule gradedModuleMap gramm graphIdeal graphRing Grassmannian groebnerBasis groupID hash hashTable heft height hermite hilbertFunction hilbertPolynomial hilbertSeries hold Hom homogenize homology homomorphism hooks horizontalJoin html httpHeaders hypertext icFracP icFractions icMap icPIdeal ideal idealizer identity image imaginaryPart importFrom independentSets index indices inducedMap inducesWellDefinedMap info input insert installAssignmentMethod installedPackages installHilbertFunction installMethod installMinprimes installPackage instance instances integralClosure integrate intersect intersectInP intersection interval inverse inverseErf inversePermutation inverseRegularizedBeta inverseRegularizedGamma inverseSystem irreducibleCharacteristicSeries irreducibleDecomposition isAffineRing isANumber isBorel isc isCanceled isCommutative isConstant isDirectory isDirectSum isEmpty isField isFinite isFinitePrimeField isFreeModule isGlobalSymbol isHomogeneous isIdeal isInfinite isInjective isInputFile isIsomorphic isIsomorphism isLiftable isLinearType isListener isLLL isMember isModule isMonomialIdeal isMutable isNormal isOpen isOutputFile isPolynomialRing isPrimary isPrime isPrimitive isProjective isPseudoprime isQuotientModule isQuotientOf isQuotientRing isReady isReal isReduction isRegularFile isRing isSkewCommutative isSorted isSquareFree isStandardGradedPolynomialRing isSubmodule isSubquotient isSubset isSupportedInZeroLocus isSurjective isTable isUnit isWellDefined isWeylAlgebra iterator jacobian jacobianDual join ker kernel kernelLLL kernelOfLocalization keys kill koszul last lcm leadCoefficient leadComponent leadMonomial leadTerm left length letterParser lift liftable limitFiles limitProcesses lines linkFile listForm listSymbols LLL lngamma load loadPackage localDictionaries localize locate log log1p lookup lookupCount LUdecomposition M2CODE makeDirectory makeDocumentTag makePackageIndex makeS2 map markedGB match mathML matrix max maxPosition member memoize memoizeClear memoizeValues merge mergePairs method methodOptions methods midpoint min mingens mingle minimalBetti minimalPresentation minimalPrimes minimalReduction minimize minimizeFilename minors minPosition minPres minprimes minus mkdir mod module modulo monoid monomialCurveIdeal monomialIdeal monomials monomialSubideal moveFile multidegree multidoc multigraded multiplicity mutable mutableIdentity mutableMatrix nanosleep needs needsPackage net netList newClass newCoordinateSystem newNetFile newPackage newRing next nextkey nextPrime NNParser nonspaceAnalyzer norm normalCone notImplemented nullhomotopy nullParser nullSpace number numcols numColumns numerator numeric numericInterval numgens numRows numrows odd oeis ofClass on openDatabase openDatabaseOut openFiles openIn openInOut openListener openOut openOutAppend optionalSignParser options optP orP override pack package packageTemplate pad pager pairs parallelApply parent part partition partitions parts pdim peek permanents permutations pfaffians pivots plus poincare poincareN polarize poly position positions power powermod precision preimage prepend presentation pretty primaryComponent primaryDecomposition print printerr printString processID product profile Proj projectiveHilbertPolynomial promote protect prune pseudocode pseudoRemainder pullback pushForward pushout QQParser QRDecomposition quotient quotientRemainder radical radicalContainment random randomKRationalPoint randomMutableMatrix rank rays read readDirectory readlink readPackage realPart realpath recursionDepth reducedRowEchelonForm reduceHilbert reductionNumber reesAlgebra reesAlgebraIdeal reesIdeal regex regexQuote registerFinalizer regSeqInIdeal regularity regularizedBeta regularizedGamma relations relativizeFilename remainder remove removeDirectory removeFile removeLowestDimension reorganize replace res reshape resolution resultant reverse right ring ringFromFractions roots rotate round rowAdd rowMult rowPermute rowRankProfile rowSwap rsort run runHooks runLengthEncode runProgram same saturate scan scanKeys scanLines scanPairs scanValues schedule schreyerOrder Schubert searchPath sec sech seeParsing select selectInSubring selectVariables separate separateRegexp sequence serialNumber set setEcho setGroupID setIOExclusive setIOSynchronized setIOUnSynchronized setRandomSeed setup setupEmacs sheaf sheafHom sheafMap show showHtml showTex simpleDocFrob sin singularLocus sinh size size2 sleep smithNormalForm solve someTerms sort sortColumns source span Spec specialFiber specialFiberIdeal splice splitWWW sqrt stack stacksProject standardForm standardPairs stashValue status store style sub sublists submatrix submatrixByDegrees subquotient subsets substitute substring subtable sum super support SVD switch sylvesterMatrix symbolBody symlinkDirectory symlinkFile symmetricAlgebra symmetricAlgebraIdeal symmetricKernel symmetricPower synonym SYNOPSIS syz syzygyScheme table take tally tan tangentCone tangentSheaf tanh target taskResult temporaryFileName tensor tensorAssociativity terminalParser terms TEST testHunekeQuestion tests tex texMath times toAbsolutePath toCC toDividedPowers toDual toExternalString toField toList toLower top topCoefficients topComponents toRR toRRi toSequence toString toUpper trace transpose trim truncate truncateOutput tutorial ultimate unbag uncurry undocumented uniform uninstallAllPackages uninstallPackage union unique uniquePermutations unsequence unstack urlEncode use userSymbols utf8 utf8check utf8substring validate value values variety vars vector versalEmbedding wait wedgeProduct weightRange whichGm width wikipedia wrap youngest zero zeta ZZParser + \ BesselJ BesselY Beta Digamma EXAMPLE End Fano GCstats GF Gamma Grassmannian Hom LLL LUdecomposition M2CODE NNParser Proj QQParser QRDecomposition SVD SYNOPSIS Schubert Spec ZZParser about abs accumulate acos acosh acot acoth addCancelTask addDependencyTask addEndFunction addHook addStartTask adjoint agm alarm all ambient analyticSpread ancestor ancestors andP ann annihilator antipode any append applicationDirectory apply applyKeys applyPairs applyTable applyValues apropos arXiv ascii asin asinh ass assert associatedGradedRing associatedPrimes atEndOfFile atan atan2 atanh autoload baseFilename baseName baseRing basis beginDocumentation benchmark betti between binomial borel cacheValue cancelTask canonicalBundle capture ceiling centerString chainComplex changeBase changeDirectory char charAnalyzer characters check checkDegrees chi class clean clearEcho code codim coefficient coefficientRing coefficients cohomology coimage coker cokernel collectGarbage columnAdd columnMult columnPermute columnRankProfile columnSwap columnate combine commandInterpreter commonRing commonest comodule compareExchange complement complete components compose compositions compress concatenate conductor cone conjugate connectionCount constParser content contract conwayPolynomial copy copyDirectory copyFile cos cosh cot cotangentSheaf coth cover coverMap cpuTime createTask csc csch currentColumnNumber currentDirectory currentPosition currentRowNumber currentTime deadParser debug debugError decompose deepSplice default degree degreeGroup degreeLength degrees degreesMonoid degreesRing delete demark denominator depth describe det determinant diagonalMatrix diameter dictionary diff difference dim directSum disassemble discriminant dismiss distinguished divideByVariable doc document drop dual eagonNorthcott echoOff echoOn eigenvalues eigenvectors eint elements eliminate endPackage entries erase erf erfc error euler eulers even examples exchange exec exp expectedReesIdeal expm1 exponents export exportFrom exportMutable expression extend exteriorPower factor fileExecutable fileExists fileLength fileMode fileReadable fileTime fileWritable fillMatrix findFiles findHeft findProgram findSynonyms first firstkey fittingIdeal flagLookup flatten flattenRing flip floor fold forceGB fork format formation frac fraction frames fromDividedPowers fromDual functionBody futureParser gb gbRemove gbSnapshot gcd gcdCoefficients gcdLLL genera generateAssertions generator generators genericMatrix genericSkewMatrix genericSymmetricMatrix gens genus get getChangeMatrix getGlobalSymbol getIOThreadMode getNetFile getNonUnit getPrimeWithRootOfUnity getSymbol getWWW getc getenv globalAssign globalAssignFunction globalAssignment globalReleaseFunction gradedModule gradedModuleMap gramm graphIdeal graphRing groebnerBasis groupID hash hashTable headlines heft height hermite hilbertFunction hilbertPolynomial hilbertSeries hold homogenize homology homomorphism hooks horizontalJoin html httpHeaders hypertext icFracP icFractions icMap icPIdeal ideal idealizer identity image imaginaryPart importFrom independentSets index indices inducedMap inducesWellDefinedMap info input insert installAssignmentMethod installHilbertFunction installMethod installMinprimes installPackage installedPackages instance instances integralClosure integrate intersect intersectInP intersection interval inverse inverseErf inversePermutation inverseRegularizedBeta inverseRegularizedGamma inverseSystem irreducibleCharacteristicSeries irreducibleDecomposition isANumber isAffineRing isBorel isCanceled isCommutative isConstant isDirectSum isDirectory isEmpty isField isFinite isFinitePrimeField isFreeModule isGlobalSymbol isHomogeneous isIdeal isInfinite isInjective isInputFile isIsomorphic isIsomorphism isLLL isLiftable isLinearType isListener isMember isModule isMonomialIdeal isMutable isNormal isOpen isOutputFile isPolynomialRing isPrimary isPrime isPrimitive isProjective isPseudoprime isQuotientModule isQuotientOf isQuotientRing isReady isReal isReduction isRegularFile isRing isSkewCommutative isSmooth isSorted isSquareFree isStandardGradedPolynomialRing isSubmodule isSubquotient isSubset isSupportedInZeroLocus isSurjective isTable isUnit isVeryAmple isWellDefined isWeylAlgebra isc iterator jacobian jacobianDual join ker kernel kernelLLL kernelOfLocalization keys kill koszul last lcm leadCoefficient leadComponent leadMonomial leadTerm left length letterParser lift liftable limitFiles limitProcesses lines linkFile listForm listSymbols lngamma load loadPackage localDictionaries localize locate log log1p lookup lookupCount makeDirectory makeDocumentTag makePackageIndex makeS2 map markedGB match mathML matrix max maxPosition member memoize memoizeClear memoizeValues merge mergePairs method methodOptions methods midpoint min minPosition minPres mingens mingle minimalBetti minimalPresentation minimalPrimes minimalReduction minimize minimizeFilename minors minprimes minus mkdir mod module modulo monoid monomialCurveIdeal monomialIdeal monomialSubideal monomials moveFile multidegree multidoc multigraded multiplicity mutable mutableIdentity mutableMatrix nanosleep needs needsPackage net netList newClass newCoordinateSystem newNetFile newPackage newRing next nextPrime nextkey nonspaceAnalyzer norm normalCone notImplemented nullParser nullSpace nullhomotopy numColumns numRows number numcols numerator numeric numericInterval numgens numrows odd oeis ofClass on openDatabase openDatabaseOut openFiles openIn openInOut openListener openOut openOutAppend optP optionalSignParser options orP override pack package packageTemplate pad pager pairs parallelApply parent part partition partitions parts pdim peek permanents permutations pfaffians pivots plus poincare poincareN polarize poly position positions power powermod precision preimage prepend presentation pretty primaryComponent primaryDecomposition print printString printerr processID product profile projectiveHilbertPolynomial promote protect prune pseudoRemainder pseudocode pullback pushForward pushout quotient quotientRemainder radical radicalContainment random randomKRationalPoint randomMutableMatrix rank rays read readDirectory readPackage readlink realPart realpath recursionDepth reduceHilbert reducedRowEchelonForm reductionNumber reesAlgebra reesAlgebraIdeal reesIdeal regSeqInIdeal regex regexQuote registerFinalizer regularity regularizedBeta regularizedGamma relations relativizeFilename remainder remove removeDirectory removeFile removeLowestDimension reorganize replace res reshape resolution resultant reverse right ring ringFromFractions roots rotate round rowAdd rowMult rowPermute rowRankProfile rowSwap rsort run runHooks runLengthEncode runProgram same saturate scan scanKeys scanLines scanPairs scanValues schedule schreyerOrder searchPath sec sech seeParsing select selectInSubring selectKeys selectPairs selectValues selectVariables separate separateRegexp sequence serialNumber set setEcho setGroupID setIOExclusive setIOSynchronized setIOUnSynchronized setRandomSeed setup setupEmacs setupLift setupPromote sheaf sheafHom sheafMap show showHtml showTex simpleDocFrob sin singularLocus sinh size size2 sleep smithNormalForm solve someTerms sort sortColumns source span specialFiber specialFiberIdeal splice splitWWW sqrt stack stacksProject standardForm standardPairs stashValue status store style sub sublists submatrix submatrixByDegrees subquotient subsets substitute substring subtable sum super support switch sylvesterMatrix symbolBody symlinkDirectory symlinkFile symmetricAlgebra symmetricAlgebraIdeal symmetricKernel symmetricPower synonym syz syzygyScheme table take tally tan tangentCone tangentSheaf tanh target taskResult temporaryFileName tensor tensorAssociativity terminalParser terms testHunekeQuestion tests tex texMath times toAbsolutePath toCC toDividedPowers toDual toExternalString toField toList toLower toRR toRRi toSequence toString toUpper top topCoefficients topComponents trace transpose trim truncate truncateOutput tutorial ultimate unbag uncurry undocumented uniform uninstallAllPackages uninstallPackage union unique uniquePermutations unsequence unstack urlEncode use userSymbols utf8 utf8check utf8substring validate value values variety vars vector versalEmbedding wait wedgeProduct weightRange whichGm width wikipedia wrap youngest zero zeta syn keyword m2Constant container - \ A1BrouwerDegrees AbstractToricVarieties Acknowledgement AdditionalPaths AdjointIdeal AdjunctionForSurfaces AfterEval AfterNoPrint AfterPrint AInfinity AlgebraicSplines Algorithm Alignment AllCodimensions allowableThreads AnalyzeSheafOnP1 applicationDirectorySuffix argument Ascending AssociativeAlgebras Authors AuxiliaryFiles backtrace Bareiss Base BaseFunction baseRings BaseRow BasisElementLimit Bayer BeforePrint BeginningMacaulay2 Benchmark BernsteinSato Bertini BettiCharacters BGG BIBasis Binary Binomial BinomialEdgeIdeals Binomials BKZ blockMatrixForm Body BoijSoederberg Book3264Examples BooleanGB Boxes Browse Bruns cache CacheExampleOutput CallLimit CannedExample CatalanConstant Caveat CellularResolutions Center Certification ChainComplexExtras ChainComplexOperations ChangeMatrix CharacteristicClasses CheckDocumentation Chordal Classic clearAll clearOutput close closeIn closeOut ClosestFit Code CodimensionLimit CodingTheory CoefficientRing Cofactor CohenEngine CohenTopLevel CohomCalg CoincidentRootLoci commandLine compactMatrixForm Complement CompleteIntersection CompleteIntersectionResolutions Complexes ConductorElement Configuration ConformalBlocks Consequences Constants Contributors ConvexInterface ConwayPolynomials copyright Core CorrespondenceScrolls CotangentSchubert Cremona currentFileDirectory currentFileName currentLayout currentPackage Cyclotomic Date dd DebuggingMode debuggingMode debugLevel DecomposableSparseSystems Decompose Default defaultPrecision Degree DegreeGroup DegreeLift DegreeLimit DegreeMap DegreeOrder DegreeRank Degrees Dense Density Depth Descending Description DeterminantalRepresentations DGAlgebras dictionaryPath DiffAlg Dispatch DivideConquer DividedPowers Divisor Dmodules docExample docTemplate Down Dynamic EagonResolution EdgeIdeals edit EigenSolver EisenbudHunekeVasconcelos Elimination EliminationMatrices EllipticCurves EllipticIntegrals Email end endl Engine engineDebugLevel EngineTests EnumerationCurves environment EquivariantGB errorDepth EulerConstant Example ExampleFiles ExampleSystems Exclude exit Ext ExteriorIdeals ExteriorModules false FastMinors FastNonminimal FGLM fileDictionaries fileExitHooks FileName FindOne FiniteFittingIdeals First FirstPackage FlatMonoid Flexible flush FollowLinks ForeignFunctions FormalGroupLaws Format FourierMotzkin FourTiTwo fpLLL FrobeniusThresholds FunctionFieldDesingularization GBDegrees gbTrace GenerateAssertions Generic GenericInitialIdeal GeometricDecomposability gfanInterface Givens GKMVarieties GLex Global GlobalAssignHook globalAssignmentHooks GlobalHookStore GlobalReleaseHook GlobalSectionLimit Gorenstein GradedLieAlgebras GraphicalModels GraphicalModelsMLE Graphics Graphs GRevLex GroebnerStrata GroebnerWalk GroupLex GroupRevLex GTZ Hadamard handleInterrupts HardDegreeLimit Heading Headline Heft Height help Hermite Hermitian HH hh HigherCIOperators HighestWeights Hilbert HodgeIntegrals HolonomicSystems homeDirectory HomePage Homogeneous Homogeneous2 HomotopyLieAlgebra HorizontalSpace HyperplaneArrangements id IgnoreExampleErrors ii incomparable Increment indeterminate Index indexComponents infinity InfoDirSection infoHelp Inhomogeneous Inputs InstallPrefix IntegralClosure interpreterDepth Intersection InvariantRing InverseMethod Inverses InverseSystems Invertible InvolutiveBases Isomorphism Item Iterate Jacobian Jets Join JSON Jupyter K3Carpets K3Surfaces Keep KeepFiles KeepZeroes Key Keywords Kronecker KustinMiller lastMatch LatticePolytopes Layout Left LengthLimit Lex LexIdeals Licenses LieTypes Limit Linear LinearAlgebra LinearTruncations lineNumber listLocalSymbols listUserSymbols LLLBases loadDepth LoadDocumentation loadedFiles loadedPackages Local LocalRings LongPolynomial M0nbar Macaulay2Doc MakeDocumentation MakeHTML MakeInfo MakeLinks MakePDF MapleInterface Markov MatchingFields MatrixSchubert Matroids maxAllowableThreads maxExponent MaximalRank MaxReductionCount MCMApproximations MergeTeX minExponent MinimalGenerators MinimalMatrix minimalPresentationMap minimalPresentationMapInv MinimalPrimes Minimize MinimumVersion Miura MixedMultiplicity ModuleDeformations MonodromySolver Monomial MonomialAlgebras MonomialIntegerPrograms MonomialOrbits MonomialOrder Monomials MonomialSize MultigradedBGG MultiGradedRationalMap MultiplicitySequence MultiplierIdeals MultiplierIdealsDim2 MultiprojectiveVarieties NAGtypes Name Nauty NautyGraphs NCAlgebra NCLex NewFromMethod newline NewMethod NewOfFromMethod NewOfMethod nil Node NoetherianOperators NoetherNormalization NonminimalComplexes NoPrint Normaliz NormalToricVarieties notify NTL null nullaryMethods NumericalAlgebraicGeometry NumericalCertification NumericalImplicitization NumericalLinearAlgebra NumericalSchubertCalculus NumericSolutions numTBBThreads OIGroebnerBases OldPolyhedra OldToricVectorBundles OnlineLookup OO oo ooo oooo OpenMath operatorAttributes OptionalComponentsPresent Options Order order OutputDictionary Outputs PackageCitations PackageDictionary PackageExports PackageImports PackageTemplate PairLimit PairsRemaining ParallelF4 ParallelizeByDegree Parametrization Parsing path PencilsOfQuadrics Permanents PHCpack PhylogeneticTrees pi PieriMaps PlaneCurveLinearSeries PlaneCurveSingularities Points Polyhedra Polymake PolyominoIdeals Posets Position PositivityToricBundles POSIX Postfix Pre Precision Prefix prefixDirectory prefixPath PrimaryDecomposition PrimaryTag PrimitiveElement Print printingAccuracy printingLeadLimit printingPrecision printingSeparator printingTimeLimit printingTrailLimit printWidth Probability profileSummary programPaths Projective Prune PruneComplex pruningMap PseudomonomialPrimaryDecomposition Pullback pullbackMaps PushForward pushoutMaps Python QthPower QuadraticIdealExamplesByRoos Quasidegrees QuaternaryQuartics QuillenSuslin quit Quotient Radical RadicalCodim1 RaiseError RandomCanonicalCurves RandomComplexes RandomCurves RandomCurvesOverVerySmallFiniteFields RandomGenus14Curves RandomIdeals RandomMonomialIdeals RandomObjects RandomPlaneCurves RandomPoints RandomSpaceCurves Range RationalMaps RationalPoints RationalPoints2 ReactionNetworks RealFP RealQP RealQP1 RealRoots RealRR RealXD recursionLimit Reduce ReesAlgebra References ReflexivePolytopesDB Regularity RelativeCanonicalResolution Reload RemakeAllDocumentation RerunExamples ResidualIntersections ResLengthThree ResolutionsOfStanleyReisnerRings restart Result Resultants returnCode Reverse RevLex Right RInterface rootPath rootURI RunDirectory RunExamples RunExternalM2 SagbiGbDetection Saturation SaturationMap Schubert2 SchurComplexes SchurFunctors SchurRings SchurVeronese scriptCommandLine SCSCP SectionRing SeeAlso SegreClasses SemidefiniteProgramming Seminormalization SeparateExec Serialization sheafExt ShimoyamaYokoyama showClassStructure showStructure showUserStructure SimpleDoc SimplicialComplexes SimplicialDecomposability SimplicialPosets SimplifyFractions SizeLimit SkewCommutative SlackIdeals SLnEquivariantMatrices SLPexpressions Sort SortStrategy SourceCode SourceRing SpaceCurves SparseResultants SpechtModule SpecialFanoFourfolds SpectralSequences SRdeformations Standard StartWithOneMinor StatePolytope StatGraphs stderr stdio StopBeforeComputation stopIfError StopIteration StopWithMinimalGenerators Strategy Strict StronglyStableIdeals Style SubalgebraBases Subnodes SubringLimit subscript Sugarless SumsOfSquares SuperLinearAlgebra superscript SVDComplexes SwitchingFields SymbolicPowers SymmetricPolynomials Synopsis Syzygies SyzygyLimit SyzygyMatrix SyzygyRows TangentCone TateOnProducts TensorComplexes TerraciniLoci Test testExample TestIdeals TeXmacs Text ThinSincereQuivers ThreadedGB Threshold Topcom topLevelMode Tor TorAlgebra Toric ToricInvariants ToricTopology ToricVectorBundles Torsion TorsionFree TotalPairs Tree TriangularSets Triangulations Tries Trim Triplets Tropical TropicalToric true Truncate Truncations TSpreadIdeals TypicalValue typicalValues Undo Unique Units Unmixed Up UpdateOnly UpperTriangular Usage UseCachedExampleOutput UseHilbertFunction UserMode UseSyzygies Valuations Variable VariableBaseName Variables Varieties Vasconcelos VectorFields VectorGraphics Verbose Verbosity Verify VersalDeformations Version version VerticalSpace viewHelp VirtualResolutions Visualize VNumber WebApp Weights WeylAlgebra WeylAlgebras WeylGroups WhitneyStratifications Wrap XML + \ A1BrouwerDegrees AbstractSimplicialComplexes AbstractToricVarieties Acknowledgement AdditionalPaths AdjointIdeal AdjunctionForSurfaces AfterEval AfterNoPrint AfterPrint AInfinity AlgebraicSplines Algorithm Alignment AllCodimensions allowableThreads AnalyzeSheafOnP1 applicationDirectorySuffix argument Ascending AssociativeAlgebras Authors AuxiliaryFiles backtrace Bareiss Base BaseFunction baseRings BaseRow BasisElementLimit Bayer BeforePrint BeginningMacaulay2 Benchmark BernsteinSato Bertini BettiCharacters BGG BIBasis Binary Binomial BinomialEdgeIdeals Binomials BKZ blockMatrixForm Body BoijSoederberg Book3264Examples BooleanGB Boxes Browse Bruns cache CacheExampleOutput CallLimit CannedExample CatalanConstant Caveat CellularResolutions Center Certification ChainComplexExtras ChainComplexOperations ChangeMatrix CharacteristicClasses CheckDocumentation Chordal cite Classic clearAll clearOutput close closeIn closeOut ClosestFit Code CodimensionLimit CodingTheory CoefficientRing Cofactor CohenEngine CohenTopLevel CohomCalg CoincidentRootLoci commandLine compactMatrixForm Complement CompleteIntersection CompleteIntersectionResolutions Complexes ConductorElement Configuration ConformalBlocks Consequences Constants Contributors ConvexInterface ConwayPolynomials copyright Core CorrespondenceScrolls CotangentSchubert Cremona currentFileDirectory currentFileName currentLayout currentPackage Cyclotomic Date dd DebuggingMode debuggingMode debugLevel DecomposableSparseSystems Decompose Default defaultPrecision Degree DegreeGroup DegreeLift DegreeLimit DegreeMap DegreeOrder DegreeRank Degrees Dense Density Depth Descending Description DeterminantalRepresentations DGAlgebras dictionaryPath DiffAlg Dispatch DivideConquer DividedPowers Divisor Dmodules docExample docTemplate Down Dynamic EagonResolution EdgeIdeals edit EigenSolver EisenbudHunekeVasconcelos Elimination EliminationMatrices EllipticCurves EllipticIntegrals Email end endl Engine engineDebugLevel EngineTests EnumerationCurves environment EquivariantGB errorDepth EulerConstant Example ExampleFiles ExampleSystems Exclude exit Ext ExteriorIdeals ExteriorModules false FastMinors FastNonminimal FGLM fileDictionaries fileExitHooks FileName FindOne FiniteFittingIdeals First FirstPackage FlatMonoid Flexible flush FollowLinks ForeignFunctions FormalGroupLaws Format FourierMotzkin FourTiTwo fpLLL FrobeniusThresholds FunctionFieldDesingularization GBDegrees gbTrace GenerateAssertions Generic GenericInitialIdeal GeometricDecomposability gfanInterface Givens GKMVarieties GLex Global GlobalAssignHook globalAssignmentHooks GlobalHookStore GlobalReleaseHook GlobalSectionLimit Gorenstein GradedLieAlgebras GraphicalModels GraphicalModelsMLE Graphics Graphs GRevLex GroebnerStrata GroebnerWalk GroupLex GroupRevLex GTZ Hadamard handleInterrupts HardDegreeLimit Heading Headline Heft Height help Hermite Hermitian HH hh HigherCIOperators HighestWeights Hilbert HodgeIntegrals HolonomicSystems homeDirectory HomePage Homogeneous Homogeneous2 HomotopyLieAlgebra HorizontalSpace HyperplaneArrangements id IgnoreExampleErrors ii incomparable Increment indeterminate Index indexComponents infinity InfoDirSection infoHelp Inhomogeneous Inputs InstallPrefix IntegralClosure interpreterDepth Intersection InvariantRing InverseMethod Inverses InverseSystems Invertible InvolutiveBases Isomorphism Item Iterate Jacobian Jets Join JSON Jupyter K3Carpets K3Surfaces Keep KeepFiles KeepZeroes Key Keywords Kronecker KustinMiller lastMatch LatticePolytopes Layout Left LengthLimit Lex LexIdeals Licenses LieTypes Limit Linear LinearAlgebra LinearTruncations lineNumber listLocalSymbols listUserSymbols LLLBases loadDepth LoadDocumentation loadedFiles loadedPackages Local LocalRings LongPolynomial M0nbar Macaulay2Doc Maintainer MakeDocumentation MakeHTML MakeInfo MakeLinks MakePDF MapleInterface Markov MatchingFields MatrixSchubert Matroids maxAllowableThreads maxExponent MaximalRank MaxReductionCount MCMApproximations MergeTeX minExponent MinimalGenerators MinimalMatrix minimalPresentationMap minimalPresentationMapInv MinimalPrimes Minimize MinimumVersion Miura MixedMultiplicity ModuleDeformations MonodromySolver Monomial MonomialAlgebras MonomialIntegerPrograms MonomialOrbits MonomialOrder Monomials MonomialSize Msolve MultigradedBGG MultigradedImplicitization MultiGradedRationalMap MultiplicitySequence MultiplierIdeals MultiplierIdealsDim2 MultiprojectiveVarieties NAGtypes Name Nauty NautyGraphs NCAlgebra NCLex NewFromMethod newline NewMethod NewOfFromMethod NewOfMethod nil Node NoetherianOperators NoetherNormalization NonminimalComplexes NoPrint Normaliz NormalToricVarieties notify NTL null nullaryMethods NumericalAlgebraicGeometry NumericalCertification NumericalImplicitization NumericalLinearAlgebra NumericalSchubertCalculus NumericalSemigroups NumericSolutions numTBBThreads OIGroebnerBases OldPolyhedra OldToricVectorBundles OnlineLookup OO oo ooo oooo OpenMath operatorAttributes OptionalComponentsPresent Options Order order OutputDictionary Outputs PackageCitations PackageDictionary PackageExports PackageImports PackageTemplate PairLimit PairsRemaining ParallelF4 ParallelizeByDegree Parametrization Parsing path PencilsOfQuadrics Permanents Permutations PHCpack PhylogeneticTrees pi PieriMaps PlaneCurveLinearSeries PlaneCurveSingularities Points Polyhedra Polymake PolyominoIdeals Posets Position PositivityToricBundles POSIX Postfix Pre Precision Prefix prefixDirectory prefixPath PrimaryDecomposition PrimaryTag PrimitiveElement Print printingAccuracy printingLeadLimit printingPrecision printingSeparator printingTimeLimit printingTrailLimit printWidth Probability profileSummary programPaths Projective Prune PruneComplex pruningMap PseudomonomialPrimaryDecomposition Pullback pullbackMaps PushForward pushoutMaps Python QthPower QuadraticIdealExamplesByRoos Quasidegrees QuaternaryQuartics QuillenSuslin quit Quotient Radical RadicalCodim1 RaiseError RandomCanonicalCurves RandomComplexes RandomCurves RandomCurvesOverVerySmallFiniteFields RandomGenus14Curves RandomIdeals RandomMonomialIdeals RandomObjects RandomPlaneCurves RandomPoints RandomSpaceCurves Range RationalMaps RationalPoints RationalPoints2 ReactionNetworks RealFP RealQP RealQP1 RealRoots RealRR RealXD recursionLimit Reduce ReesAlgebra References ReflexivePolytopesDB Regularity RelativeCanonicalResolution Reload RemakeAllDocumentation RerunExamples ResidualIntersections ResLengthThree ResolutionsOfStanleyReisnerRings restart Result Resultants returnCode Reverse RevLex Right RInterface rootPath rootURI RunDirectory RunExamples RunExternalM2 SagbiGbDetection Saturation SaturationMap Schubert2 SchurComplexes SchurFunctors SchurRings SchurVeronese SCMAlgebras scriptCommandLine SCSCP SectionRing SeeAlso SegreClasses SemidefiniteProgramming Seminormalization SeparateExec Serialization sheafExt ShimoyamaYokoyama showClassStructure showStructure showUserStructure SimpleDoc SimplicialComplexes SimplicialDecomposability SimplicialPosets SimplifyFractions SizeLimit SkewCommutative SlackIdeals SLnEquivariantMatrices SLPexpressions Sort SortStrategy SourceCode SourceRing SpaceCurves SparseResultants SpechtModule SpecialFanoFourfolds SpectralSequences SRdeformations Standard StartWithOneMinor StatePolytope StatGraphs stderr stdio StopBeforeComputation stopIfError StopIteration StopWithMinimalGenerators Strategy Strict StronglyStableIdeals Style SubalgebraBases Subnodes SubringLimit subscript Sugarless SumsOfSquares SuperLinearAlgebra superscript SVDComplexes SwitchingFields SymbolicPowers SymmetricPolynomials Synopsis Syzygies SyzygyLimit SyzygyMatrix SyzygyRows TangentCone TateOnProducts TensorComplexes TerraciniLoci Test testExample TestIdeals TeXmacs Text ThinSincereQuivers ThreadedGB Threads Threshold Topcom topLevelMode Tor TorAlgebra Toric ToricInvariants ToricTopology ToricVectorBundles Torsion TorsionFree TotalPairs Tree TriangularSets Triangulations Tries Trim Triplets Tropical TropicalToric true Truncate Truncations TSpreadIdeals TypicalValue typicalValues Undo Unique Units Unmixed Up UpdateOnly UpperTriangular Usage UseCachedExampleOutput UseHilbertFunction UserMode UseSyzygies Valuations Variable VariableBaseName Variables Varieties Vasconcelos VectorFields VectorGraphics Verbose Verbosity Verify VersalDeformations Version version VerticalSpace viewHelp VirtualResolutions Visualize VNumber WebApp Weights WeylAlgebra WeylAlgebras WeylGroups WhitneyStratifications Wrap XML syn keyword m2Symbol contained - \ A1BrouwerDegrees about abs AbstractToricVarieties accumulate Acknowledgement acos acosh acot acoth addCancelTask addDependencyTask addEndFunction addHook AdditionalPaths addStartFunction addStartTask Adjacent adjoint AdjointIdeal AdjunctionForSurfaces AffineVariety AfterEval AfterNoPrint AfterPrint agm AInfinity alarm AlgebraicSplines Algorithm Alignment all AllCodimensions allowableThreads ambient analyticSpread Analyzer AnalyzeSheafOnP1 ancestor ancestors ANCHOR and andP AngleBarList ann annihilator antipode any append applicationDirectory applicationDirectorySuffix apply applyKeys applyPairs applyTable applyValues apropos argument Array arXiv Ascending ascii asin asinh ass assert associatedGradedRing associatedPrimes AssociativeAlgebras AssociativeExpression atan atan2 atanh atEndOfFile AtomicInt Authors autoload AuxiliaryFiles backtrace Bag Bareiss Base baseFilename BaseFunction baseName baseRing baseRings BaseRow BasicList basis BasisElementLimit Bayer BeforePrint beginDocumentation BeginningMacaulay2 Benchmark benchmark BernsteinSato Bertini BesselJ BesselY Beta betti BettiCharacters BettiTally between BGG BIBasis Binary BinaryOperation Binomial binomial BinomialEdgeIdeals Binomials BKZ blockMatrixForm BLOCKQUOTE BODY Body BoijSoederberg BOLD Book3264Examples Boolean BooleanGB borel Boxes BR break Browse Bruns BUTTON cache CacheExampleOutput CacheFunction CacheTable cacheValue CallLimit cancelTask canonicalBundle capture CatalanConstant catch Caveat CC CDATA ceiling CellularResolutions Center centerString Certification ChainComplex chainComplex ChainComplexExtras ChainComplexMap ChainComplexOperations changeBase ChangeMatrix char CharacteristicClasses characters charAnalyzer check checkDegrees CheckDocumentation chi Chordal class Classic clean clearAll clearEcho clearOutput close closeIn closeOut ClosestFit CODE code codim CodimensionLimit CodingTheory coefficient CoefficientRing coefficientRing coefficients Cofactor CohenEngine CohenTopLevel CoherentSheaf CohomCalg cohomology coimage CoincidentRootLoci coker cokernel collectGarbage columnAdd columnate columnMult columnPermute columnRankProfile columnSwap combine Command commandInterpreter commandLine COMMENT commonest commonRing comodule compactMatrixForm compareExchange CompiledFunction CompiledFunctionBody CompiledFunctionClosure Complement complement complete CompleteIntersection CompleteIntersectionResolutions Complexes ComplexField components compose compositions compress concatenate conductor ConductorElement cone Configuration ConformalBlocks conjugate connectionCount Consequences Constant Constants constParser content continue contract Contributors ConvexInterface conwayPolynomial ConwayPolynomials copy copyDirectory copyFile copyright Core CorrespondenceScrolls cos cosh cot CotangentSchubert cotangentSheaf coth cover coverMap cpuTime createTask Cremona csc csch current currentColumnNumber currentDirectory currentFileDirectory currentFileName currentLayout currentPackage currentPosition currentRowNumber currentString currentTime Cyclotomic Database Date DD dd deadParser debug debugError DebuggingMode debuggingMode debugLevel DecomposableSparseSystems Decompose decompose deepSplice Default default defaultPrecision Degree degree DegreeGroup degreeGroup degreeLength DegreeLift DegreeLimit DegreeMap DegreeOrder DegreeRank Degrees degrees degreesMonoid degreesRing delete demark denominator Dense Density Depth depth Descending Descent Describe describe Description det determinant DeterminantalRepresentations DGAlgebras diagonalMatrix diameter Dictionary dictionary dictionaryPath diff DiffAlg difference Digamma dim DirectSum directSum disassemble discriminant dismiss Dispatch distinguished DIV Divide divideByVariable DivideConquer DividedPowers Divisor DL Dmodules do doc docExample docTemplate document DocumentTag Down drop DT dual Dynamic eagonNorthcott EagonResolution echoOff echoOn EdgeIdeals edit EigenSolver eigenvalues eigenvectors eint EisenbudHunekeVasconcelos elapsedTime elapsedTiming elements Eliminate eliminate Elimination EliminationMatrices EllipticCurves EllipticIntegrals else EM Email End end endl endPackage Engine engineDebugLevel EngineRing EngineTests entries EnumerationCurves environment Equation EquivariantGB erase erf erfc error errorDepth euler EulerConstant eulers even EXAMPLE ExampleFiles ExampleItem examples ExampleSystems exchange Exclude exec exit exp expectedReesIdeal expm1 exponents export exportFrom exportMutable Expression expression Ext extend ExteriorIdeals ExteriorModules exteriorPower factor false Fano FastMinors FastNonminimal FGLM File fileDictionaries fileExecutable fileExists fileExitHooks fileLength fileMode FileName FilePosition fileReadable fileTime fileWritable fillMatrix findFiles findHeft FindOne findProgram findSynonyms FiniteFittingIdeals First first firstkey FirstPackage fittingIdeal flagLookup FlatMonoid flatten flattenRing Flexible flip floor flush fold FollowLinks for forceGB ForeignFunctions fork FormalGroupLaws Format format formation FourierMotzkin FourTiTwo fpLLL frac fraction FractionField frames FrobeniusThresholds from fromDividedPowers fromDual Function FunctionApplication FunctionBody functionBody FunctionClosure FunctionFieldDesingularization futureParser GaloisField Gamma gb GBDegrees gbRemove gbSnapshot gbTrace gcd gcdCoefficients gcdLLL GCstats genera GeneralOrderedMonoid GenerateAssertions generateAssertions generator generators Generic GenericInitialIdeal genericMatrix genericSkewMatrix genericSymmetricMatrix gens genus GeometricDecomposability get getc getChangeMatrix getenv getGlobalSymbol getIOThreadMode getNetFile getNonUnit getPrimeWithRootOfUnity getSymbol getWWW GF gfanInterface Givens GKMVarieties GLex Global global globalAssign globalAssignFunction GlobalAssignHook globalAssignment globalAssignmentHooks GlobalDictionary GlobalHookStore globalReleaseFunction GlobalReleaseHook GlobalSectionLimit Gorenstein GradedLieAlgebras GradedModule gradedModule GradedModuleMap gradedModuleMap gramm GraphicalModels GraphicalModelsMLE Graphics graphIdeal graphRing Graphs Grassmannian GRevLex GroebnerBasis groebnerBasis GroebnerBasisOptions GroebnerStrata GroebnerWalk groupID GroupLex GroupRevLex GTZ Hadamard handleInterrupts HardDegreeLimit hash HashTable hashTable HEAD HEADER1 HEADER2 HEADER3 HEADER4 HEADER5 HEADER6 HeaderType Heading Headline Heft heft Height height help Hermite hermite Hermitian HH hh HigherCIOperators HighestWeights Hilbert hilbertFunction hilbertPolynomial hilbertSeries HodgeIntegrals hold Holder HolonomicSystems Hom homeDirectory HomePage Homogeneous Homogeneous2 homogenize homology homomorphism HomotopyLieAlgebra hooks horizontalJoin HorizontalSpace HR HREF HTML html httpHeaders Hybrid HyperplaneArrangements Hypertext hypertext HypertextContainer HypertextParagraph HypertextVoid icFracP icFractions icMap icPIdeal id Ideal ideal idealizer identity if IgnoreExampleErrors ii image imaginaryPart IMG ImmutableType importFrom in incomparable Increment INDENT independentSets indeterminate IndeterminateNumber Index index indexComponents IndexedVariable IndexedVariableTable indices inducedMap inducesWellDefinedMap InexactField InexactFieldFamily InexactNumber InfiniteNumber infinity info InfoDirSection infoHelp Inhomogeneous INPUT input Inputs insert installAssignmentMethod installedPackages installHilbertFunction installMethod installMinprimes installPackage InstallPrefix instance instances IntegralClosure integralClosure integrate IntermediateMarkUpType interpreterDepth intersect intersectInP Intersection intersection interval InvariantRing inverse inverseErf InverseMethod inversePermutation inverseRegularizedBeta inverseRegularizedGamma Inverses inverseSystem InverseSystems Invertible InvolutiveBases irreducibleCharacteristicSeries irreducibleDecomposition isAffineRing isANumber isBorel isc isCanceled isCommutative isConstant isDirectory isDirectSum isEmpty isField isFinite isFinitePrimeField isFreeModule isGlobalSymbol isHomogeneous isIdeal isInfinite isInjective isInputFile isIsomorphic isIsomorphism isLiftable isLinearType isListener isLLL isMember isModule isMonomialIdeal isMutable isNormal Isomorphism isOpen isOutputFile isPolynomialRing isPrimary isPrime isPrimitive isProjective isPseudoprime isQuotientModule isQuotientOf isQuotientRing isReady isReal isReduction isRegularFile isRing isSkewCommutative isSorted isSquareFree isStandardGradedPolynomialRing isSubmodule isSubquotient isSubset isSupportedInZeroLocus isSurjective isTable isUnit isWellDefined isWeylAlgebra ITALIC Iterate Iterator iterator Jacobian jacobian jacobianDual Jets Join join JSON Jupyter K3Carpets K3Surfaces KBD Keep KeepFiles KeepZeroes ker kernel kernelLLL kernelOfLocalization Key keys Keyword Keywords kill koszul Kronecker KustinMiller LABEL last lastMatch LATER LatticePolytopes Layout lcm leadCoefficient leadComponent leadMonomial leadTerm Left left length LengthLimit letterParser Lex LexIdeals LI Licenses LieTypes lift liftable Limit limitFiles limitProcesses Linear LinearAlgebra LinearTruncations lineNumber lines LINK linkFile List list listForm listLocalSymbols listSymbols listUserSymbols LITERAL LLL LLLBases lngamma load loadDepth LoadDocumentation loadedFiles loadedPackages loadPackage Local local localDictionaries LocalDictionary localize LocalRings locate log log1p LongPolynomial lookup lookupCount LowerBound LUdecomposition M0nbar M2CODE Macaulay2Doc makeDirectory MakeDocumentation makeDocumentTag MakeHTML MakeInfo MakeLinks makePackageIndex MakePDF makeS2 Manipulator map MapExpression MapleInterface markedGB Markov MarkUpType match MatchingFields mathML Matrix matrix MatrixExpression MatrixSchubert Matroids max maxAllowableThreads maxExponent MaximalRank maxPosition MaxReductionCount MCMApproximations member memoize memoizeClear memoizeValues MENU merge mergePairs MergeTeX META method MethodFunction MethodFunctionBinary MethodFunctionSingle MethodFunctionWithOptions methodOptions methods midpoint min minExponent mingens mingle minimalBetti MinimalGenerators MinimalMatrix minimalPresentation minimalPresentationMap minimalPresentationMapInv MinimalPrimes minimalPrimes minimalReduction Minimize minimize minimizeFilename MinimumVersion minors minPosition minPres minprimes Minus minus Miura MixedMultiplicity mkdir mod Module module ModuleDeformations modulo MonodromySolver Monoid monoid MonoidElement Monomial MonomialAlgebras monomialCurveIdeal MonomialIdeal monomialIdeal MonomialIntegerPrograms MonomialOrbits MonomialOrder Monomials monomials MonomialSize monomialSubideal moveFile multidegree multidoc multigraded MultigradedBettiTally MultigradedBGG MultiGradedRationalMap multiplicity MultiplicitySequence MultiplierIdeals MultiplierIdealsDim2 MultiprojectiveVarieties mutable MutableHashTable mutableIdentity MutableList MutableMatrix mutableMatrix NAGtypes Name nanosleep Nauty NautyGraphs NCAlgebra NCLex needs needsPackage Net net NetFile netList new newClass newCoordinateSystem NewFromMethod newline NewMethod newNetFile NewOfFromMethod NewOfMethod newPackage newRing next nextkey nextPrime nil NNParser NoetherianOperators NoetherNormalization NonminimalComplexes nonspaceAnalyzer NoPrint norm normalCone Normaliz NormalToricVarieties not Nothing notify notImplemented NTL null nullaryMethods nullhomotopy nullParser nullSpace Number number NumberedVerticalList numcols numColumns numerator numeric NumericalAlgebraicGeometry NumericalCertification NumericalImplicitization NumericalLinearAlgebra NumericalSchubertCalculus numericInterval NumericSolutions numgens numRows numrows numTBBThreads odd oeis of ofClass OIGroebnerBases OL OldPolyhedra OldToricVectorBundles on OneExpression OnlineLookup OO oo ooo oooo openDatabase openDatabaseOut openFiles openIn openInOut openListener OpenMath openOut openOutAppend operatorAttributes Option OptionalComponentsPresent optionalSignParser Options options OptionTable optP or Order order OrderedMonoid orP OutputDictionary Outputs override pack Package package PackageCitations PackageDictionary PackageExports PackageImports PackageTemplate packageTemplate pad pager PairLimit pairs PairsRemaining PARA parallelApply ParallelF4 ParallelizeByDegree Parametrization parent Parenthesize Parser Parsing part Partition partition partitions parts path pdim peek PencilsOfQuadrics Permanents permanents permutations pfaffians PHCpack PhylogeneticTrees pi PieriMaps pivots PlaneCurveLinearSeries PlaneCurveSingularities plus poincare poincareN Points polarize poly Polyhedra Polymake PolynomialRing PolyominoIdeals Posets Position position positions PositivityToricBundles POSIX Postfix Power power powermod PRE Precision precision Prefix prefixDirectory prefixPath preimage prepend presentation pretty primaryComponent PrimaryDecomposition primaryDecomposition PrimaryTag PrimitiveElement Print print printerr printingAccuracy printingLeadLimit printingPrecision printingSeparator printingTimeLimit printingTrailLimit printString printWidth Probability processID Product product ProductOrder profile profileSummary Program programPaths ProgramRun Proj Projective ProjectiveHilbertPolynomial projectiveHilbertPolynomial ProjectiveVariety promote protect Prune prune PruneComplex pruningMap Pseudocode pseudocode PseudomonomialPrimaryDecomposition pseudoRemainder Pullback pullback pullbackMaps PushForward pushForward pushout pushoutMaps Python QQ QQParser QRDecomposition QthPower QuadraticIdealExamplesByRoos Quasidegrees QuaternaryQuartics QuillenSuslin quit Quotient quotient quotientRemainder QuotientRing Radical radical RadicalCodim1 radicalContainment RaiseError random RandomCanonicalCurves RandomComplexes RandomCurves RandomCurvesOverVerySmallFiniteFields RandomGenus14Curves RandomIdeals randomKRationalPoint RandomMonomialIdeals randomMutableMatrix RandomObjects RandomPlaneCurves RandomPoints RandomSpaceCurves Range rank RationalMaps RationalPoints RationalPoints2 rays ReactionNetworks read readDirectory readlink readPackage RealField RealFP realPart realpath RealQP RealQP1 RealRoots RealRR RealXD recursionDepth recursionLimit Reduce reducedRowEchelonForm reduceHilbert reductionNumber ReesAlgebra reesAlgebra reesAlgebraIdeal reesIdeal References ReflexivePolytopesDB regex regexQuote registerFinalizer regSeqInIdeal Regularity regularity regularizedBeta regularizedGamma relations RelativeCanonicalResolution relativizeFilename Reload remainder RemakeAllDocumentation remove removeDirectory removeFile removeLowestDimension reorganize replace RerunExamples res reshape ResidualIntersections ResLengthThree Resolution resolution ResolutionsOfStanleyReisnerRings restart Result resultant Resultants return returnCode Reverse reverse RevLex Right right Ring ring RingElement RingFamily ringFromFractions RingMap RInterface rootPath roots rootURI rotate round rowAdd RowExpression rowMult rowPermute rowRankProfile rowSwap RR RRi rsort run RunDirectory RunExamples RunExternalM2 runHooks runLengthEncode runProgram SagbiGbDetection same SAMP saturate Saturation SaturationMap scan scanKeys scanLines scanPairs scanValues schedule schreyerOrder Schubert Schubert2 SchurComplexes SchurFunctors SchurRings SchurVeronese SCRIPT scriptCommandLine ScriptedFunctor SCSCP searchPath sec sech SectionRing SeeAlso seeParsing SegreClasses select selectInSubring selectVariables SelfInitializingType SemidefiniteProgramming Seminormalization separate SeparateExec separateRegexp Sequence sequence Serialization serialNumber Set set setEcho setGroupID setIOExclusive setIOSynchronized setIOUnSynchronized setRandomSeed setup setupEmacs sheaf SheafExpression sheafExt sheafHom SheafMap sheafMap SheafOfRings shield ShimoyamaYokoyama show showClassStructure showHtml showStructure showTex showUserStructure SimpleDoc simpleDocFrob SimplicialComplexes SimplicialDecomposability SimplicialPosets SimplifyFractions sin singularLocus sinh size size2 SizeLimit SkewCommutative SlackIdeals sleep SLnEquivariantMatrices SLPexpressions SMALL smithNormalForm solve someTerms Sort sort sortColumns SortStrategy source SourceCode SourceRing SPACE SpaceCurves SPAN span SparseMonomialVectorExpression SparseResultants SparseVectorExpression Spec SpechtModule SpecialFanoFourfolds specialFiber specialFiberIdeal SpectralSequences splice splitWWW sqrt SRdeformations stack stacksProject Standard standardForm standardPairs StartWithOneMinor stashValue StatePolytope StatGraphs status stderr stdio step StopBeforeComputation stopIfError StopIteration StopWithMinimalGenerators store Strategy Strict String STRONG StronglyStableIdeals STYLE Style style SUB sub SubalgebraBases sublists submatrix submatrixByDegrees Subnodes subquotient SubringLimit Subscript subscript SUBSECTION subsets substitute substring subtable Sugarless Sum sum SumOfTwists SumsOfSquares SUP super SuperLinearAlgebra Superscript superscript support SVD SVDComplexes switch SwitchingFields sylvesterMatrix Symbol symbol SymbolBody symbolBody SymbolicPowers symlinkDirectory symlinkFile symmetricAlgebra symmetricAlgebraIdeal symmetricKernel SymmetricPolynomials symmetricPower synonym SYNOPSIS syz Syzygies SyzygyLimit SyzygyMatrix SyzygyRows syzygyScheme TABLE Table table take Tally tally tan TangentCone tangentCone tangentSheaf tanh target Task taskResult TateOnProducts TD temporaryFileName tensor tensorAssociativity TensorComplexes TensorProduct terminalParser terms TerraciniLoci TEST Test testExample testHunekeQuestion TestIdeals TestInput tests TEX tex TeXmacs texMath Text TH then Thing ThinSincereQuivers ThreadedGB threadLocal threadVariable Threshold throw Time time times timing TITLE TO to TO2 toAbsolutePath toCC toDividedPowers toDual toExternalString toField TOH toList toLower top topCoefficients Topcom topComponents topLevelMode Tor TorAlgebra Toric ToricInvariants ToricTopology ToricVectorBundles toRR toRRi Torsion TorsionFree toSequence toString TotalPairs toUpper TR trace transpose TriangularSets Triangulations Tries Trim trim Triplets Tropical TropicalToric true Truncate truncate truncateOutput Truncations try TSpreadIdeals TT tutorial Type TypicalValue typicalValues UL ultimate unbag uncurry Undo undocumented uniform uninstallAllPackages uninstallPackage union Unique unique uniquePermutations Units Unmixed unsequence unstack Up UpdateOnly UpperTriangular URL urlEncode Usage use UseCachedExampleOutput UseHilbertFunction UserMode userSymbols UseSyzygies utf8 utf8check utf8substring validate Valuations value values VAR Variable VariableBaseName Variables Varieties Variety variety vars Vasconcelos Vector vector VectorExpression VectorFields VectorGraphics Verbose Verbosity Verify VersalDeformations versalEmbedding Version version VerticalList VerticalSpace viewHelp VirtualResolutions VirtualTally VisibleList Visualize VNumber wait WebApp wedgeProduct weightRange Weights WeylAlgebra WeylAlgebras WeylGroups when whichGm while WhitneyStratifications width wikipedia Wrap wrap WrapperType XML xor youngest zero ZeroExpression zeta ZZ ZZParser + \ A1BrouwerDegrees AInfinity ANCHOR AbstractSimplicialComplexes AbstractToricVarieties Acknowledgement AdditionalPaths Adjacent AdjointIdeal AdjunctionForSurfaces AffineVariety AfterEval AfterNoPrint AfterPrint AlgebraicSplines Algorithm Alignment AllCodimensions AnalyzeSheafOnP1 Analyzer AngleBarList Array Ascending AssociativeAlgebras AssociativeExpression AtomicInt Authors AuxiliaryFiles BGG BIBasis BKZ BLOCKQUOTE BODY BOLD BR BUTTON Bag Bareiss Base BaseFunction BaseRow BasicList BasisElementLimit Bayer BeforePrint BeginningMacaulay2 Benchmark BernsteinSato Bertini BesselJ BesselY Beta BettiCharacters BettiTally Binary BinaryOperation Binomial BinomialEdgeIdeals Binomials Body BoijSoederberg Book3264Examples Boolean BooleanGB Boxes Browse Bruns CC CDATA CODE COMMENT CacheExampleOutput CacheFunction CacheTable CallLimit CatalanConstant Caveat CellularResolutions Center Certification ChainComplex ChainComplexExtras ChainComplexMap ChainComplexOperations ChangeMatrix CharacteristicClasses CheckDocumentation Chordal Classic ClosestFit CodimensionLimit CodingTheory CoefficientRing Cofactor CohenEngine CohenTopLevel CoherentSheaf CohomCalg CoincidentRootLoci Command CompiledFunction CompiledFunctionBody CompiledFunctionClosure Complement CompleteIntersection CompleteIntersectionResolutions ComplexField Complexes ConductorElement Configuration ConformalBlocks Consequences Constant Constants Contributors ConvexInterface ConwayPolynomials Core CorrespondenceScrolls CotangentSchubert Cremona Cyclotomic DD DGAlgebras DIV DL DT Database Date DebuggingMode DecomposableSparseSystems Decompose Default Degree DegreeGroup DegreeLift DegreeLimit DegreeMap DegreeOrder DegreeRank Degrees Dense Density Depth Descending Descent Describe Description DeterminantalRepresentations Dictionary DiffAlg Digamma DirectSum Dispatch Divide DivideConquer DividedPowers Divisor Dmodules DocumentTag Down Dynamic EM EXAMPLE EagonResolution EdgeIdeals EigenSolver EisenbudHunekeVasconcelos Eliminate Elimination EliminationMatrices EllipticCurves EllipticIntegrals Email End Engine EngineRing EngineTests EnumerationCurves Equation EquivariantGB EulerConstant ExampleFiles ExampleItem ExampleSystems Exclude Expression Ext ExteriorIdeals ExteriorModules FGLM Fano FastMinors FastNonminimal File FileName FilePosition FindOne FiniteFittingIdeals First FirstPackage FlatMonoid Flexible FollowLinks ForeignFunctions FormalGroupLaws Format FourTiTwo FourierMotzkin FractionField FrobeniusThresholds Function FunctionApplication FunctionBody FunctionClosure FunctionFieldDesingularization GBDegrees GCstats GF GKMVarieties GLex GRevLex GTZ GaloisField Gamma GeneralOrderedMonoid GenerateAssertions Generic GenericInitialIdeal GeometricDecomposability Givens Global GlobalAssignHook GlobalDictionary GlobalHookStore GlobalReleaseHook GlobalSectionLimit Gorenstein GradedLieAlgebras GradedModule GradedModuleMap GraphicalModels GraphicalModelsMLE Graphics Graphs Grassmannian GroebnerBasis GroebnerBasisOptions GroebnerStrata GroebnerWalk GroupLex GroupRevLex HEAD HEADER1 HEADER2 HEADER3 HEADER4 HEADER5 HEADER6 HH HR HREF HTML Hadamard HardDegreeLimit HashTable HeaderType Heading Headline Heft Height Hermite Hermitian HigherCIOperators HighestWeights Hilbert HodgeIntegrals Holder HolonomicSystems Hom HomePage Homogeneous Homogeneous2 HomotopyLieAlgebra HorizontalSpace Hybrid HyperplaneArrangements Hypertext HypertextContainer HypertextParagraph HypertextVoid IMG INDENT INPUT ITALIC Ideal IgnoreExampleErrors ImmutableType Increment IndeterminateNumber Index IndexedVariable IndexedVariableTable InexactField InexactFieldFamily InexactNumber InfiniteNumber InfoDirSection Inhomogeneous Inputs InstallPrefix IntegralClosure IntermediateMarkUpType Intersection InvariantRing InverseMethod InverseSystems Inverses Invertible InvolutiveBases Isomorphism Iterate Iterator JSON Jacobian Jets Join Jupyter K3Carpets K3Surfaces KBD Keep KeepFiles KeepZeroes Key Keyword Keywords Kronecker KustinMiller LABEL LATER LI LINK LITERAL LLL LLLBases LUdecomposition LatticePolytopes Layout Left LengthLimit Lex LexIdeals Licenses LieTypes Limit Linear LinearAlgebra LinearTruncations List LoadDocumentation Local LocalDictionary LocalRings LongPolynomial LowerBound M0nbar M2CODE MCMApproximations MENU META Macaulay2Doc Maintainer MakeDocumentation MakeHTML MakeInfo MakeLinks MakePDF Manipulator MapExpression MapleInterface MarkUpType Markov MatchingFields Matrix MatrixExpression MatrixSchubert Matroids MaxReductionCount MaximalRank MergeTeX MethodFunction MethodFunctionBinary MethodFunctionSingle MethodFunctionWithOptions MinimalGenerators MinimalMatrix MinimalPrimes Minimize MinimumVersion Minus Miura MixedMultiplicity Module ModuleDeformations MonodromySolver Monoid MonoidElement Monomial MonomialAlgebras MonomialIdeal MonomialIntegerPrograms MonomialOrbits MonomialOrder MonomialSize Monomials Msolve MultiGradedRationalMap MultigradedBGG MultigradedBettiTally MultigradedImplicitization MultiplicitySequence MultiplierIdeals MultiplierIdealsDim2 MultiprojectiveVarieties MutableHashTable MutableList MutableMatrix NAGtypes NCAlgebra NCLex NNParser NTL Name Nauty NautyGraphs Net NetFile NewFromMethod NewMethod NewOfFromMethod NewOfMethod NoPrint NoetherNormalization NoetherianOperators NonminimalComplexes NormalToricVarieties Normaliz Nothing Number NumberedVerticalList NumericSolutions NumericalAlgebraicGeometry NumericalCertification NumericalImplicitization NumericalLinearAlgebra NumericalSchubertCalculus NumericalSemigroups OIGroebnerBases OL OO OldPolyhedra OldToricVectorBundles OneExpression OnlineLookup OpenMath Option OptionTable OptionalComponentsPresent Options Order OrderedMonoid OutputDictionary Outputs PARA PHCpack POSIX PRE Package PackageCitations PackageDictionary PackageExports PackageImports PackageTemplate PairLimit PairsRemaining ParallelF4 ParallelizeByDegree Parametrization Parenthesize Parser Parsing Partition PencilsOfQuadrics Permanents Permutations PhylogeneticTrees PieriMaps PlaneCurveLinearSeries PlaneCurveSingularities Points Polyhedra Polymake PolynomialRing PolyominoIdeals Posets Position PositivityToricBundles Postfix Power Precision Prefix PrimaryDecomposition PrimaryTag PrimitiveElement Print Probability Product ProductOrder Program ProgramRun Proj Projective ProjectiveHilbertPolynomial ProjectiveVariety Prune PruneComplex Pseudocode PseudocodeClosure PseudomonomialPrimaryDecomposition Pullback PushForward Python QQ QQParser QRDecomposition QthPower QuadraticIdealExamplesByRoos Quasidegrees QuaternaryQuartics QuillenSuslin Quotient QuotientRing RInterface RR RRi Radical RadicalCodim1 RaiseError RandomCanonicalCurves RandomComplexes RandomCurves RandomCurvesOverVerySmallFiniteFields RandomGenus14Curves RandomIdeals RandomMonomialIdeals RandomObjects RandomPlaneCurves RandomPoints RandomSpaceCurves Range RationalMaps RationalPoints RationalPoints2 ReactionNetworks RealFP RealField RealQP RealQP1 RealRR RealRoots RealXD Reduce ReesAlgebra References ReflexivePolytopesDB Regularity RelativeCanonicalResolution Reload RemakeAllDocumentation RerunExamples ResLengthThree ResidualIntersections Resolution ResolutionsOfStanleyReisnerRings Result Resultants RevLex Reverse Right Ring RingElement RingFamily RingMap RowExpression RunDirectory RunExamples RunExternalM2 SAMP SCMAlgebras SCRIPT SCSCP SLPexpressions SLnEquivariantMatrices SMALL SPACE SPAN SRdeformations STRONG STYLE SUB SUBSECTION SUP SVD SVDComplexes SYNOPSIS SagbiGbDetection Saturation SaturationMap Schubert Schubert2 SchurComplexes SchurFunctors SchurRings SchurVeronese ScriptedFunctor SectionRing SeeAlso SegreClasses SelfInitializingType SemidefiniteProgramming Seminormalization SeparateExec Sequence Serialization Set SheafExpression SheafMap SheafOfRings ShimoyamaYokoyama SimpleDoc SimplicialComplexes SimplicialDecomposability SimplicialPosets SimplifyFractions SizeLimit SkewCommutative SlackIdeals Sort SortStrategy SourceCode SourceRing SpaceCurves SparseMonomialVectorExpression SparseResultants SparseVectorExpression Spec SpechtModule SpecialFanoFourfolds SpectralSequences Standard StartWithOneMinor StatGraphs StatePolytope StopBeforeComputation StopIteration StopWithMinimalGenerators Strategy Strict String StronglyStableIdeals Style SubalgebraBases Subnodes SubringLimit Subscript Sugarless Sum SumOfTwists SumsOfSquares SuperLinearAlgebra Superscript SwitchingFields Symbol SymbolBody SymbolicPowers SymmetricPolynomials Syzygies SyzygyLimit SyzygyMatrix SyzygyRows TABLE TD TEST TEX TH TITLE TO TO2 TOH TR TSpreadIdeals TT Table Tally TangentCone Task TateOnProducts TeXmacs TensorComplexes TensorProduct TerraciniLoci Test TestIdeals TestInput Text ThinSincereQuivers Thing ThreadedGB Threads Threshold Time Topcom Tor TorAlgebra Toric ToricInvariants ToricTopology ToricVectorBundles Torsion TorsionFree TotalPairs TriangularSets Triangulations Tries Trim Triplets Tropical TropicalToric Truncate Truncations Type TypicalValue UL URL Undo Unique Units Unmixed Up UpdateOnly UpperTriangular Usage UseCachedExampleOutput UseHilbertFunction UseSyzygies UserMode VAR VNumber Valuations Variable VariableBaseName Variables Varieties Variety Vasconcelos Vector VectorExpression VectorFields VectorGraphics Verbose Verbosity Verify VersalDeformations Version VerticalList VerticalSpace VirtualResolutions VirtualTally VisibleList Visualize WebApp Weights WeylAlgebra WeylAlgebras WeylGroups WhitneyStratifications Wrap WrapperType XML ZZ ZZParser ZeroExpression about abs accumulate acos acosh acot acoth addCancelTask addDependencyTask addEndFunction addHook addStartTask adjoint agm alarm all allowableThreads ambient analyticSpread ancestor ancestors and andP ann annihilator antipode any append applicationDirectory applicationDirectorySuffix apply applyKeys applyPairs applyTable applyValues apropos arXiv argument ascii asin asinh ass assert associatedGradedRing associatedPrimes atEndOfFile atan atan2 atanh autoload backtrace baseFilename baseName baseRing baseRings basis beginDocumentation benchmark betti between binomial blockMatrixForm borel break cache cacheValue cancelTask canonicalBundle capture catch ceiling centerString chainComplex changeBase changeDirectory char charAnalyzer characters check checkDegrees chi cite class clean clearAll clearEcho clearOutput close closeIn closeOut code codim coefficient coefficientRing coefficients cohomology coimage coker cokernel collectGarbage columnAdd columnMult columnPermute columnRankProfile columnSwap columnate combine commandInterpreter commandLine commonRing commonest comodule compactMatrixForm compareExchange complement complete components compose compositions compress concatenate conductor cone conjugate connectionCount constParser content continue contract conwayPolynomial copy copyDirectory copyFile copyright cos cosh cot cotangentSheaf coth cover coverMap cpuTime createTask csc csch current currentColumnNumber currentDirectory currentFileDirectory currentFileName currentLayout currentPackage currentPosition currentRowNumber currentString currentTime dd deadParser debug debugError debugLevel debuggingMode decompose deepSplice default defaultPrecision degree degreeGroup degreeLength degrees degreesMonoid degreesRing delete demark denominator depth describe det determinant diagonalMatrix diameter dictionary dictionaryPath diff difference dim directSum disassemble discriminant dismiss distinguished divideByVariable do doc docExample docTemplate document drop dual eagonNorthcott echoOff echoOn edit eigenvalues eigenvectors eint elapsedTime elapsedTiming elements eliminate else end endPackage endl engineDebugLevel entries environment erase erf erfc error errorDepth euler eulers even examples exchange exec exit exp expectedReesIdeal expm1 exponents export exportFrom exportMutable expression extend exteriorPower factor false fileDictionaries fileExecutable fileExists fileExitHooks fileLength fileMode fileReadable fileTime fileWritable fillMatrix findFiles findHeft findProgram findSynonyms first firstkey fittingIdeal flagLookup flatten flattenRing flip floor flush fold for forceGB fork format formation fpLLL frac fraction frames from fromDividedPowers fromDual functionBody futureParser gb gbRemove gbSnapshot gbTrace gcd gcdCoefficients gcdLLL genera generateAssertions generator generators genericMatrix genericSkewMatrix genericSymmetricMatrix gens genus get getChangeMatrix getGlobalSymbol getIOThreadMode getNetFile getNonUnit getPrimeWithRootOfUnity getSymbol getWWW getc getenv gfanInterface global globalAssign globalAssignFunction globalAssignment globalAssignmentHooks globalReleaseFunction gradedModule gradedModuleMap gramm graphIdeal graphRing groebnerBasis groupID handleInterrupts hash hashTable headlines heft height help hermite hh hilbertFunction hilbertPolynomial hilbertSeries hold homeDirectory homogenize homology homomorphism hooks horizontalJoin html httpHeaders hypertext icFracP icFractions icMap icPIdeal id ideal idealizer identity if ii image imaginaryPart importFrom in incomparable independentSets indeterminate index indexComponents indices inducedMap inducesWellDefinedMap infinity info infoHelp input insert installAssignmentMethod installHilbertFunction installMethod installMinprimes installPackage installedPackages instance instances integralClosure integrate interpreterDepth intersect intersectInP intersection interval inverse inverseErf inversePermutation inverseRegularizedBeta inverseRegularizedGamma inverseSystem irreducibleCharacteristicSeries irreducibleDecomposition isANumber isAffineRing isBorel isCanceled isCommutative isConstant isDirectSum isDirectory isEmpty isField isFinite isFinitePrimeField isFreeModule isGlobalSymbol isHomogeneous isIdeal isInfinite isInjective isInputFile isIsomorphic isIsomorphism isLLL isLiftable isLinearType isListener isMember isModule isMonomialIdeal isMutable isNormal isOpen isOutputFile isPolynomialRing isPrimary isPrime isPrimitive isProjective isPseudoprime isQuotientModule isQuotientOf isQuotientRing isReady isReal isReduction isRegularFile isRing isSkewCommutative isSmooth isSorted isSquareFree isStandardGradedPolynomialRing isSubmodule isSubquotient isSubset isSupportedInZeroLocus isSurjective isTable isUnit isVeryAmple isWellDefined isWeylAlgebra isc iterator jacobian jacobianDual join ker kernel kernelLLL kernelOfLocalization keys kill koszul last lastMatch lcm leadCoefficient leadComponent leadMonomial leadTerm left length letterParser lift liftable limitFiles limitProcesses lineNumber lines linkFile list listForm listLocalSymbols listSymbols listUserSymbols lngamma load loadDepth loadPackage loadedFiles loadedPackages local localDictionaries localize locate log log1p lookup lookupCount makeDirectory makeDocumentTag makePackageIndex makeS2 map markedGB match mathML matrix max maxAllowableThreads maxExponent maxPosition member memoize memoizeClear memoizeValues merge mergePairs method methodOptions methods midpoint min minExponent minPosition minPres mingens mingle minimalBetti minimalPresentation minimalPresentationMap minimalPresentationMapInv minimalPrimes minimalReduction minimize minimizeFilename minors minprimes minus mkdir mod module modulo monoid monomialCurveIdeal monomialIdeal monomialSubideal monomials moveFile multidegree multidoc multigraded multiplicity mutable mutableIdentity mutableMatrix nanosleep needs needsPackage net netList new newClass newCoordinateSystem newNetFile newPackage newRing newline next nextPrime nextkey nil nonspaceAnalyzer norm normalCone not notImplemented notify null nullParser nullSpace nullaryMethods nullhomotopy numColumns numRows numTBBThreads number numcols numerator numeric numericInterval numgens numrows odd oeis of ofClass on oo ooo oooo openDatabase openDatabaseOut openFiles openIn openInOut openListener openOut openOutAppend operatorAttributes optP optionalSignParser options or orP order override pack package packageTemplate pad pager pairs parallelApply parent part partition partitions parts path pdim peek permanents permutations pfaffians pi pivots plus poincare poincareN polarize poly position positions power powermod precision prefixDirectory prefixPath preimage prepend presentation pretty primaryComponent primaryDecomposition print printString printWidth printerr printingAccuracy printingLeadLimit printingPrecision printingSeparator printingTimeLimit printingTrailLimit processID product profile profileSummary programPaths projectiveHilbertPolynomial promote protect prune pruningMap pseudoRemainder pseudocode pullback pullbackMaps pushForward pushout pushoutMaps quit quotient quotientRemainder radical radicalContainment random randomKRationalPoint randomMutableMatrix rank rays read readDirectory readPackage readlink realPart realpath recursionDepth recursionLimit reduceHilbert reducedRowEchelonForm reductionNumber reesAlgebra reesAlgebraIdeal reesIdeal regSeqInIdeal regex regexQuote registerFinalizer regularity regularizedBeta regularizedGamma relations relativizeFilename remainder remove removeDirectory removeFile removeLowestDimension reorganize replace res reshape resolution restart resultant return returnCode reverse right ring ringFromFractions rootPath rootURI roots rotate round rowAdd rowMult rowPermute rowRankProfile rowSwap rsort run runHooks runLengthEncode runProgram same saturate scan scanKeys scanLines scanPairs scanValues schedule schreyerOrder scriptCommandLine searchPath sec sech seeParsing select selectInSubring selectKeys selectPairs selectValues selectVariables separate separateRegexp sequence serialNumber set setEcho setGroupID setIOExclusive setIOSynchronized setIOUnSynchronized setRandomSeed setup setupEmacs setupLift setupPromote sheaf sheafExt sheafHom sheafMap shield show showClassStructure showHtml showStructure showTex showUserStructure simpleDocFrob sin singularLocus sinh size size2 sleep smithNormalForm solve someTerms sort sortColumns source span specialFiber specialFiberIdeal splice splitWWW sqrt stack stacksProject standardForm standardPairs stashValue status stderr stdio step stopIfError store style sub sublists submatrix submatrixByDegrees subquotient subscript subsets substitute substring subtable sum super superscript support switch sylvesterMatrix symbol symbolBody symlinkDirectory symlinkFile symmetricAlgebra symmetricAlgebraIdeal symmetricKernel symmetricPower synonym syz syzygyScheme table take tally tan tangentCone tangentSheaf tanh target taskResult temporaryFileName tensor tensorAssociativity terminalParser terms testExample testHunekeQuestion tests tex texMath then threadLocal threadVariable throw time times timing to toAbsolutePath toCC toDividedPowers toDual toExternalString toField toList toLower toRR toRRi toSequence toString toUpper top topCoefficients topComponents topLevelMode trace transpose trim true truncate truncateOutput try tutorial typicalValues ultimate unbag uncurry undocumented uniform uninstallAllPackages uninstallPackage union unique uniquePermutations unsequence unstack urlEncode use userSymbols utf8 utf8check utf8substring validate value values variety vars vector versalEmbedding version viewHelp wait wedgeProduct weightRange when whichGm while width wikipedia wrap xor youngest zero zeta let b:current_syntax = "m2" From 3b8f93c3aa33b579c0d7c4fc3577926140bd038e Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 20:51:46 -0400 Subject: [PATCH 211/226] Update prism.js symbols for version 1.24.11. --- M2/Macaulay2/packages/Style/prism.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/Style/prism.js b/M2/Macaulay2/packages/Style/prism.js index 43da1db589b..ded8908ff45 100644 --- a/M2/Macaulay2/packages/Style/prism.js +++ b/M2/Macaulay2/packages/Style/prism.js @@ -1,2 +1,2 @@ /*! For license information please see prism.js.LICENSE.txt */ -(()=>{var e={432:()=>{Prism.languages.m2=Prism.languages.macaulay2={comment:[{pattern:/(^|[^\\])\-\*[\s\S]*?(?:\*\-|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\-\-.*/,lookbehind:!0,greedy:!0}],string:[{pattern:/"(?:\\[\s\S]|(?!")[^\\])*"/,greedy:!0},{pattern:/\/\/\/(\/(?!\/)|(?:\/\/)+(?!\/)|[^\/])*(?:\/\/)+\/(?!\/)/,greedy:!0}],keyword:/\b(?:and|break|catch|continue|do|elapsedTime|elapsedTiming|else|for|from|global|if|in|list|local|new|not|of|or|return|shield|SPACE|step|symbol|then|threadLocal|threadVariable|throw|time|timing|to|try|when|while|xor)\b/,"class-name":/\b(?:Adjacent|AffineVariety|Analyzer|ANCHOR|AngleBarList|Array|AssociativeExpression|AtomicInt|Bag|BasicList|BettiTally|BinaryOperation|BLOCKQUOTE|BODY|BOLD|Boolean|BR|BUTTON|CacheFunction|CacheTable|CC|CDATA|ChainComplex|ChainComplexMap|CODE|CoherentSheaf|Command|COMMENT|CompiledFunction|CompiledFunctionBody|CompiledFunctionClosure|ComplexField|Constant|Database|DD|Descent|Describe|Dictionary|DirectSum|DIV|Divide|DL|DocumentTag|DT|Eliminate|EM|EngineRing|Equation|ExampleItem|Expression|File|FilePosition|FractionField|Function|FunctionApplication|FunctionBody|FunctionClosure|GaloisField|GeneralOrderedMonoid|GlobalDictionary|GradedModule|GradedModuleMap|GroebnerBasis|GroebnerBasisOptions|HashTable|HEAD|HEADER1|HEADER2|HEADER3|HEADER4|HEADER5|HEADER6|HeaderType|Holder|HR|HREF|HTML|Hybrid|Hypertext|HypertextContainer|HypertextParagraph|HypertextVoid|Ideal|IMG|ImmutableType|INDENT|IndeterminateNumber|IndexedVariable|IndexedVariableTable|InexactField|InexactFieldFamily|InexactNumber|InfiniteNumber|INPUT|IntermediateMarkUpType|ITALIC|Iterator|KBD|Keyword|LABEL|LATER|LI|LINK|List|LITERAL|LocalDictionary|LowerBound|Manipulator|MapExpression|MarkUpType|Matrix|MatrixExpression|MENU|META|MethodFunction|MethodFunctionBinary|MethodFunctionSingle|MethodFunctionWithOptions|Minus|Module|Monoid|MonoidElement|MonomialIdeal|MultigradedBettiTally|MutableHashTable|MutableList|MutableMatrix|Net|NetFile|Nothing|Number|NumberedVerticalList|OL|OneExpression|Option|OptionTable|OrderedMonoid|Package|PARA|Parenthesize|Parser|Partition|PolynomialRing|Power|PRE|Product|ProductOrder|Program|ProgramRun|ProjectiveHilbertPolynomial|ProjectiveVariety|Pseudocode|QQ|QuotientRing|RealField|Resolution|Ring|RingElement|RingFamily|RingMap|RowExpression|RR|RRi|SAMP|SCRIPT|ScriptedFunctor|SelfInitializingType|Sequence|Set|SheafExpression|SheafMap|SheafOfRings|SMALL|SPAN|SparseMonomialVectorExpression|SparseVectorExpression|String|STRONG|STYLE|SUB|Subscript|SUBSECTION|Sum|SumOfTwists|SUP|Superscript|Symbol|SymbolBody|TABLE|Table|Tally|Task|TD|TensorProduct|TestInput|TEX|TH|Thing|Time|TITLE|TO|TO2|TOH|TR|TT|Type|UL|URL|VAR|Variety|Vector|VectorExpression|VerticalList|VirtualTally|VisibleList|WrapperType|ZeroExpression|ZZ)\b/,function:/\b(?:about|abs|accumulate|acos|acosh|acot|acoth|addCancelTask|addDependencyTask|addEndFunction|addHook|addStartFunction|addStartTask|adjoint|agm|alarm|all|ambient|analyticSpread|ancestor|ancestors|andP|ann|annihilator|antipode|any|append|applicationDirectory|apply|applyKeys|applyPairs|applyTable|applyValues|apropos|arXiv|ascii|asin|asinh|ass|assert|associatedGradedRing|associatedPrimes|atan|atan2|atanh|atEndOfFile|autoload|baseFilename|baseName|baseRing|basis|beginDocumentation|benchmark|BesselJ|BesselY|Beta|betti|between|binomial|borel|cacheValue|cancelTask|canonicalBundle|capture|ceiling|centerString|chainComplex|changeBase|char|characters|charAnalyzer|check|checkDegrees|chi|class|clean|clearEcho|code|codim|coefficient|coefficientRing|coefficients|cohomology|coimage|coker|cokernel|collectGarbage|columnAdd|columnate|columnMult|columnPermute|columnRankProfile|columnSwap|combine|commandInterpreter|commonest|commonRing|comodule|compareExchange|complement|complete|components|compose|compositions|compress|concatenate|conductor|cone|conjugate|connectionCount|constParser|content|contract|conwayPolynomial|copy|copyDirectory|copyFile|cos|cosh|cot|cotangentSheaf|coth|cover|coverMap|cpuTime|createTask|csc|csch|currentColumnNumber|currentDirectory|currentPosition|currentRowNumber|currentTime|deadParser|debug|debugError|decompose|deepSplice|default|degree|degreeGroup|degreeLength|degrees|degreesMonoid|degreesRing|delete|demark|denominator|depth|describe|det|determinant|diagonalMatrix|diameter|dictionary|diff|difference|Digamma|dim|directSum|disassemble|discriminant|dismiss|distinguished|divideByVariable|doc|document|drop|dual|eagonNorthcott|echoOff|echoOn|eigenvalues|eigenvectors|eint|elements|eliminate|End|endPackage|entries|erase|erf|erfc|error|euler|eulers|even|EXAMPLE|examples|exchange|exec|exp|expectedReesIdeal|expm1|exponents|export|exportFrom|exportMutable|expression|extend|exteriorPower|factor|Fano|fileExecutable|fileExists|fileLength|fileMode|fileReadable|fileTime|fileWritable|fillMatrix|findFiles|findHeft|findProgram|findSynonyms|first|firstkey|fittingIdeal|flagLookup|flatten|flattenRing|flip|floor|fold|forceGB|fork|format|formation|frac|fraction|frames|fromDividedPowers|fromDual|functionBody|futureParser|Gamma|gb|gbRemove|gbSnapshot|gcd|gcdCoefficients|gcdLLL|GCstats|genera|generateAssertions|generator|generators|genericMatrix|genericSkewMatrix|genericSymmetricMatrix|gens|genus|get|getc|getChangeMatrix|getenv|getGlobalSymbol|getIOThreadMode|getNetFile|getNonUnit|getPrimeWithRootOfUnity|getSymbol|getWWW|GF|globalAssign|globalAssignFunction|globalAssignment|globalReleaseFunction|gradedModule|gradedModuleMap|gramm|graphIdeal|graphRing|Grassmannian|groebnerBasis|groupID|hash|hashTable|heft|height|hermite|hilbertFunction|hilbertPolynomial|hilbertSeries|hold|Hom|homogenize|homology|homomorphism|hooks|horizontalJoin|html|httpHeaders|hypertext|icFracP|icFractions|icMap|icPIdeal|ideal|idealizer|identity|image|imaginaryPart|importFrom|independentSets|index|indices|inducedMap|inducesWellDefinedMap|info|input|insert|installAssignmentMethod|installedPackages|installHilbertFunction|installMethod|installMinprimes|installPackage|instance|instances|integralClosure|integrate|intersect|intersectInP|intersection|interval|inverse|inverseErf|inversePermutation|inverseRegularizedBeta|inverseRegularizedGamma|inverseSystem|irreducibleCharacteristicSeries|irreducibleDecomposition|isAffineRing|isANumber|isBorel|isc|isCanceled|isCommutative|isConstant|isDirectory|isDirectSum|isEmpty|isField|isFinite|isFinitePrimeField|isFreeModule|isGlobalSymbol|isHomogeneous|isIdeal|isInfinite|isInjective|isInputFile|isIsomorphic|isIsomorphism|isLiftable|isLinearType|isListener|isLLL|isMember|isModule|isMonomialIdeal|isMutable|isNormal|isOpen|isOutputFile|isPolynomialRing|isPrimary|isPrime|isPrimitive|isProjective|isPseudoprime|isQuotientModule|isQuotientOf|isQuotientRing|isReady|isReal|isReduction|isRegularFile|isRing|isSkewCommutative|isSorted|isSquareFree|isStandardGradedPolynomialRing|isSubmodule|isSubquotient|isSubset|isSupportedInZeroLocus|isSurjective|isTable|isUnit|isWellDefined|isWeylAlgebra|iterator|jacobian|jacobianDual|join|ker|kernel|kernelLLL|kernelOfLocalization|keys|kill|koszul|last|lcm|leadCoefficient|leadComponent|leadMonomial|leadTerm|left|length|letterParser|lift|liftable|limitFiles|limitProcesses|lines|linkFile|listForm|listSymbols|LLL|lngamma|load|loadPackage|localDictionaries|localize|locate|log|log1p|lookup|lookupCount|LUdecomposition|M2CODE|makeDirectory|makeDocumentTag|makePackageIndex|makeS2|map|markedGB|match|mathML|matrix|max|maxPosition|member|memoize|memoizeClear|memoizeValues|merge|mergePairs|method|methodOptions|methods|midpoint|min|mingens|mingle|minimalBetti|minimalPresentation|minimalPrimes|minimalReduction|minimize|minimizeFilename|minors|minPosition|minPres|minprimes|minus|mkdir|mod|module|modulo|monoid|monomialCurveIdeal|monomialIdeal|monomials|monomialSubideal|moveFile|multidegree|multidoc|multigraded|multiplicity|mutable|mutableIdentity|mutableMatrix|nanosleep|needs|needsPackage|net|netList|newClass|newCoordinateSystem|newNetFile|newPackage|newRing|next|nextkey|nextPrime|NNParser|nonspaceAnalyzer|norm|normalCone|notImplemented|nullhomotopy|nullParser|nullSpace|number|numcols|numColumns|numerator|numeric|numericInterval|numgens|numRows|numrows|odd|oeis|ofClass|on|openDatabase|openDatabaseOut|openFiles|openIn|openInOut|openListener|openOut|openOutAppend|optionalSignParser|options|optP|orP|override|pack|package|packageTemplate|pad|pager|pairs|parallelApply|parent|part|partition|partitions|parts|pdim|peek|permanents|permutations|pfaffians|pivots|plus|poincare|poincareN|polarize|poly|position|positions|power|powermod|precision|preimage|prepend|presentation|pretty|primaryComponent|primaryDecomposition|print|printerr|printString|processID|product|profile|Proj|projectiveHilbertPolynomial|promote|protect|prune|pseudocode|pseudoRemainder|pullback|pushForward|pushout|QQParser|QRDecomposition|quotient|quotientRemainder|radical|radicalContainment|random|randomKRationalPoint|randomMutableMatrix|rank|rays|read|readDirectory|readlink|readPackage|realPart|realpath|recursionDepth|reducedRowEchelonForm|reduceHilbert|reductionNumber|reesAlgebra|reesAlgebraIdeal|reesIdeal|regex|regexQuote|registerFinalizer|regSeqInIdeal|regularity|regularizedBeta|regularizedGamma|relations|relativizeFilename|remainder|remove|removeDirectory|removeFile|removeLowestDimension|reorganize|replace|res|reshape|resolution|resultant|reverse|right|ring|ringFromFractions|roots|rotate|round|rowAdd|rowMult|rowPermute|rowRankProfile|rowSwap|rsort|run|runHooks|runLengthEncode|runProgram|same|saturate|scan|scanKeys|scanLines|scanPairs|scanValues|schedule|schreyerOrder|Schubert|searchPath|sec|sech|seeParsing|select|selectInSubring|selectVariables|separate|separateRegexp|sequence|serialNumber|set|setEcho|setGroupID|setIOExclusive|setIOSynchronized|setIOUnSynchronized|setRandomSeed|setup|setupEmacs|sheaf|sheafHom|sheafMap|show|showHtml|showTex|simpleDocFrob|sin|singularLocus|sinh|size|size2|sleep|smithNormalForm|solve|someTerms|sort|sortColumns|source|span|Spec|specialFiber|specialFiberIdeal|splice|splitWWW|sqrt|stack|stacksProject|standardForm|standardPairs|stashValue|status|store|style|sub|sublists|submatrix|submatrixByDegrees|subquotient|subsets|substitute|substring|subtable|sum|super|support|SVD|switch|sylvesterMatrix|symbolBody|symlinkDirectory|symlinkFile|symmetricAlgebra|symmetricAlgebraIdeal|symmetricKernel|symmetricPower|synonym|SYNOPSIS|syz|syzygyScheme|table|take|tally|tan|tangentCone|tangentSheaf|tanh|target|taskResult|temporaryFileName|tensor|tensorAssociativity|terminalParser|terms|TEST|testHunekeQuestion|tests|tex|texMath|times|toAbsolutePath|toCC|toDividedPowers|toDual|toExternalString|toField|toList|toLower|top|topCoefficients|topComponents|toRR|toRRi|toSequence|toString|toUpper|trace|transpose|trim|truncate|truncateOutput|tutorial|ultimate|unbag|uncurry|undocumented|uniform|uninstallAllPackages|uninstallPackage|union|unique|uniquePermutations|unsequence|unstack|urlEncode|use|userSymbols|utf8|utf8check|utf8substring|validate|value|values|variety|vars|vector|versalEmbedding|wait|wedgeProduct|weightRange|whichGm|width|wikipedia|wrap|youngest|zero|zeta|ZZParser)\b/,constant:/\b(?:A1BrouwerDegrees|AbstractToricVarieties|Acknowledgement|AdditionalPaths|AdjointIdeal|AdjunctionForSurfaces|AfterEval|AfterNoPrint|AfterPrint|AInfinity|AlgebraicSplines|Algorithm|Alignment|AllCodimensions|allowableThreads|AnalyzeSheafOnP1|applicationDirectorySuffix|argument|Ascending|AssociativeAlgebras|Authors|AuxiliaryFiles|backtrace|Bareiss|Base|BaseFunction|baseRings|BaseRow|BasisElementLimit|Bayer|BeforePrint|BeginningMacaulay2|Benchmark|BernsteinSato|Bertini|BettiCharacters|BGG|BIBasis|Binary|Binomial|BinomialEdgeIdeals|Binomials|BKZ|blockMatrixForm|Body|BoijSoederberg|Book3264Examples|BooleanGB|Boxes|Browse|Bruns|cache|CacheExampleOutput|CallLimit|CannedExample|CatalanConstant|Caveat|CellularResolutions|Center|Certification|ChainComplexExtras|ChainComplexOperations|ChangeMatrix|CharacteristicClasses|CheckDocumentation|Chordal|Classic|clearAll|clearOutput|close|closeIn|closeOut|ClosestFit|Code|CodimensionLimit|CodingTheory|CoefficientRing|Cofactor|CohenEngine|CohenTopLevel|CohomCalg|CoincidentRootLoci|commandLine|compactMatrixForm|Complement|CompleteIntersection|CompleteIntersectionResolutions|Complexes|ConductorElement|Configuration|ConformalBlocks|Consequences|Constants|Contributors|ConvexInterface|ConwayPolynomials|copyright|Core|CorrespondenceScrolls|CotangentSchubert|Cremona|currentFileDirectory|currentFileName|currentLayout|currentPackage|Cyclotomic|Date|dd|DebuggingMode|debuggingMode|debugLevel|DecomposableSparseSystems|Decompose|Default|defaultPrecision|Degree|DegreeGroup|DegreeLift|DegreeLimit|DegreeMap|DegreeOrder|DegreeRank|Degrees|Dense|Density|Depth|Descending|Description|DeterminantalRepresentations|DGAlgebras|dictionaryPath|DiffAlg|Dispatch|DivideConquer|DividedPowers|Divisor|Dmodules|docExample|docTemplate|Down|Dynamic|EagonResolution|EdgeIdeals|edit|EigenSolver|EisenbudHunekeVasconcelos|Elimination|EliminationMatrices|EllipticCurves|EllipticIntegrals|Email|end|endl|Engine|engineDebugLevel|EngineTests|EnumerationCurves|environment|EquivariantGB|errorDepth|EulerConstant|Example|ExampleFiles|ExampleSystems|Exclude|exit|Ext|ExteriorIdeals|ExteriorModules|false|FastMinors|FastNonminimal|FGLM|fileDictionaries|fileExitHooks|FileName|FindOne|FiniteFittingIdeals|First|FirstPackage|FlatMonoid|Flexible|flush|FollowLinks|ForeignFunctions|FormalGroupLaws|Format|FourierMotzkin|FourTiTwo|fpLLL|FrobeniusThresholds|FunctionFieldDesingularization|GBDegrees|gbTrace|GenerateAssertions|Generic|GenericInitialIdeal|GeometricDecomposability|gfanInterface|Givens|GKMVarieties|GLex|Global|GlobalAssignHook|globalAssignmentHooks|GlobalHookStore|GlobalReleaseHook|GlobalSectionLimit|Gorenstein|GradedLieAlgebras|GraphicalModels|GraphicalModelsMLE|Graphics|Graphs|GRevLex|GroebnerStrata|GroebnerWalk|GroupLex|GroupRevLex|GTZ|Hadamard|handleInterrupts|HardDegreeLimit|Heading|Headline|Heft|Height|help|Hermite|Hermitian|HH|hh|HigherCIOperators|HighestWeights|Hilbert|HodgeIntegrals|HolonomicSystems|homeDirectory|HomePage|Homogeneous|Homogeneous2|HomotopyLieAlgebra|HorizontalSpace|HyperplaneArrangements|id|IgnoreExampleErrors|ii|incomparable|Increment|indeterminate|Index|indexComponents|infinity|InfoDirSection|infoHelp|Inhomogeneous|Inputs|InstallPrefix|IntegralClosure|interpreterDepth|Intersection|InvariantRing|InverseMethod|Inverses|InverseSystems|Invertible|InvolutiveBases|Isomorphism|Item|Iterate|Jacobian|Jets|Join|JSON|Jupyter|K3Carpets|K3Surfaces|Keep|KeepFiles|KeepZeroes|Key|Keywords|Kronecker|KustinMiller|lastMatch|LatticePolytopes|Layout|Left|LengthLimit|Lex|LexIdeals|Licenses|LieTypes|Limit|Linear|LinearAlgebra|LinearTruncations|lineNumber|listLocalSymbols|listUserSymbols|LLLBases|loadDepth|LoadDocumentation|loadedFiles|loadedPackages|Local|LocalRings|LongPolynomial|M0nbar|Macaulay2Doc|MakeDocumentation|MakeHTML|MakeInfo|MakeLinks|MakePDF|MapleInterface|Markov|MatchingFields|MatrixSchubert|Matroids|maxAllowableThreads|maxExponent|MaximalRank|MaxReductionCount|MCMApproximations|MergeTeX|minExponent|MinimalGenerators|MinimalMatrix|minimalPresentationMap|minimalPresentationMapInv|MinimalPrimes|Minimize|MinimumVersion|Miura|MixedMultiplicity|ModuleDeformations|MonodromySolver|Monomial|MonomialAlgebras|MonomialIntegerPrograms|MonomialOrbits|MonomialOrder|Monomials|MonomialSize|MultigradedBGG|MultiGradedRationalMap|MultiplicitySequence|MultiplierIdeals|MultiplierIdealsDim2|MultiprojectiveVarieties|NAGtypes|Name|Nauty|NautyGraphs|NCAlgebra|NCLex|NewFromMethod|newline|NewMethod|NewOfFromMethod|NewOfMethod|nil|Node|NoetherianOperators|NoetherNormalization|NonminimalComplexes|NoPrint|Normaliz|NormalToricVarieties|notify|NTL|null|nullaryMethods|NumericalAlgebraicGeometry|NumericalCertification|NumericalImplicitization|NumericalLinearAlgebra|NumericalSchubertCalculus|NumericSolutions|numTBBThreads|OIGroebnerBases|OldPolyhedra|OldToricVectorBundles|OnlineLookup|OO|oo|ooo|oooo|OpenMath|operatorAttributes|OptionalComponentsPresent|Options|Order|order|OutputDictionary|Outputs|PackageCitations|PackageDictionary|PackageExports|PackageImports|PackageTemplate|PairLimit|PairsRemaining|ParallelF4|ParallelizeByDegree|Parametrization|Parsing|path|PencilsOfQuadrics|Permanents|PHCpack|PhylogeneticTrees|pi|PieriMaps|PlaneCurveLinearSeries|PlaneCurveSingularities|Points|Polyhedra|Polymake|PolyominoIdeals|Posets|Position|PositivityToricBundles|POSIX|Postfix|Pre|Precision|Prefix|prefixDirectory|prefixPath|PrimaryDecomposition|PrimaryTag|PrimitiveElement|Print|printingAccuracy|printingLeadLimit|printingPrecision|printingSeparator|printingTimeLimit|printingTrailLimit|printWidth|Probability|profileSummary|programPaths|Projective|Prune|PruneComplex|pruningMap|PseudomonomialPrimaryDecomposition|Pullback|pullbackMaps|PushForward|pushoutMaps|Python|QthPower|QuadraticIdealExamplesByRoos|Quasidegrees|QuaternaryQuartics|QuillenSuslin|quit|Quotient|Radical|RadicalCodim1|RaiseError|RandomCanonicalCurves|RandomComplexes|RandomCurves|RandomCurvesOverVerySmallFiniteFields|RandomGenus14Curves|RandomIdeals|RandomMonomialIdeals|RandomObjects|RandomPlaneCurves|RandomPoints|RandomSpaceCurves|Range|RationalMaps|RationalPoints|RationalPoints2|ReactionNetworks|RealFP|RealQP|RealQP1|RealRoots|RealRR|RealXD|recursionLimit|Reduce|ReesAlgebra|References|ReflexivePolytopesDB|Regularity|RelativeCanonicalResolution|Reload|RemakeAllDocumentation|RerunExamples|ResidualIntersections|ResLengthThree|ResolutionsOfStanleyReisnerRings|restart|Result|Resultants|returnCode|Reverse|RevLex|Right|RInterface|rootPath|rootURI|RunDirectory|RunExamples|RunExternalM2|SagbiGbDetection|Saturation|SaturationMap|Schubert2|SchurComplexes|SchurFunctors|SchurRings|SchurVeronese|scriptCommandLine|SCSCP|SectionRing|SeeAlso|SegreClasses|SemidefiniteProgramming|Seminormalization|SeparateExec|Serialization|sheafExt|ShimoyamaYokoyama|showClassStructure|showStructure|showUserStructure|SimpleDoc|SimplicialComplexes|SimplicialDecomposability|SimplicialPosets|SimplifyFractions|SizeLimit|SkewCommutative|SlackIdeals|SLnEquivariantMatrices|SLPexpressions|Sort|SortStrategy|SourceCode|SourceRing|SpaceCurves|SparseResultants|SpechtModule|SpecialFanoFourfolds|SpectralSequences|SRdeformations|Standard|StartWithOneMinor|StatePolytope|StatGraphs|stderr|stdio|StopBeforeComputation|stopIfError|StopIteration|StopWithMinimalGenerators|Strategy|Strict|StronglyStableIdeals|Style|SubalgebraBases|Subnodes|SubringLimit|subscript|Sugarless|SumsOfSquares|SuperLinearAlgebra|superscript|SVDComplexes|SwitchingFields|SymbolicPowers|SymmetricPolynomials|Synopsis|Syzygies|SyzygyLimit|SyzygyMatrix|SyzygyRows|TangentCone|TateOnProducts|TensorComplexes|TerraciniLoci|Test|testExample|TestIdeals|TeXmacs|Text|ThinSincereQuivers|ThreadedGB|Threshold|Topcom|topLevelMode|Tor|TorAlgebra|Toric|ToricInvariants|ToricTopology|ToricVectorBundles|Torsion|TorsionFree|TotalPairs|Tree|TriangularSets|Triangulations|Tries|Trim|Triplets|Tropical|TropicalToric|true|Truncate|Truncations|TSpreadIdeals|TypicalValue|typicalValues|Undo|Unique|Units|Unmixed|Up|UpdateOnly|UpperTriangular|Usage|UseCachedExampleOutput|UseHilbertFunction|UserMode|UseSyzygies|Valuations|Variable|VariableBaseName|Variables|Varieties|Vasconcelos|VectorFields|VectorGraphics|Verbose|Verbosity|Verify|VersalDeformations|Version|version|VerticalSpace|viewHelp|VirtualResolutions|Visualize|VNumber|WebApp|Weights|WeylAlgebra|WeylAlgebras|WeylGroups|WhitneyStratifications|Wrap|XML)\b/}},415:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var a=n(601),i=n.n(a),r=n(314),o=n.n(r)()(i());o.push([e.id,'/* PrismJS 1.14.0\nhttp://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */\n/**\n * prism.js theme for Macaulay2\n 2018 P. Zinn-Justin\n */\n\n/*\ncode[class*="language-"],\npre[class*="language-"] {\n\tcolor: black;\n\tbackground: none;\n\ttext-shadow: 0 1px white;\n\tfont-family: Consolas, Monaco, \'Andale Mono\', \'Ubuntu Mono\', monospace;\n\ttext-align: left;\n\twhite-space: pre;\n\tword-spacing: normal;\n\tword-break: normal;\n\tword-wrap: normal;\n\tline-height: 1.5;\n\n\t-moz-tab-size: 4;\n\t-o-tab-size: 4;\n\ttab-size: 4;\n\n\t-webkit-hyphens: none;\n\t-moz-hyphens: none;\n\t-ms-hyphens: none;\n\thyphens: none;\n}\n\npre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,\ncode[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {\n\ttext-shadow: none;\n\tbackground: #b3d4fc;\n}\n\npre[class*="language-"]::selection, pre[class*="language-"] ::selection,\ncode[class*="language-"]::selection, code[class*="language-"] ::selection {\n\ttext-shadow: none;\n\tbackground: #b3d4fc;\n}\n\n@media print {\n\tcode[class*="language-"],\n\tpre[class*="language-"] {\n\t\ttext-shadow: none;\n\t}\n}\n*/\n/* Code blocks */\n/*\npre[class*="language-"] {\n\tpadding: 1em;\n\tmargin: .5em 0;\n\toverflow: auto;\n}\n\n:not(pre) > code[class*="language-"],\npre[class*="language-"] {\n\tbackground: #f5f2f0;\n}\n*/\n/* Inline code */\n/*\n:not(pre) > code[class*="language-"] {\n\tpadding: .1em;\n\tborder-radius: .3em;\n\twhite-space: normal;\n}\n*/\n.token.comment {\n color: #607080;\n}\n\n/*\n.token.punctuation {\n\tcolor: #999;\n}\n\n.namespace {\n\topacity: .7;\n}\n*/\n\n.token.constant {\n /*\tcolor: #008b8b; */\n color: #004060;\n}\n\n.token.net,\n.token.string {\n\tcolor: #8b2252;\n}\n\n/*\n.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string {\n\tcolor: #9a6e3a;\n\tbackground: hsla(0, 0%, 100%, .5);\n}\n*/\n\n.token.keyword {\n color: #a020f0;\n}\n\n.token.function {\n color: #0000ff;\n}\n.token.class-name {\n /* color: #228b22; */\n color: #1c701c;\n}\n\n/*\n.token.regex,\n.token.important,\n.token.variable {\n\tcolor: #e90;\n}\n\n.token.important,\n.token.bold {\n\tfont-weight: bold;\n}\n.token.italic {\n\tfont-style: italic;\n}\n\n.token.entity {\n\tcursor: help;\n}\n*/\n',""]);const s=o},314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",a=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),a&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),a&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,a,i,r){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(a)for(var s=0;s0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=r),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},601:e=>{"use strict";e.exports=function(e){return e[1]}},848:(e,t,n)=>{var a=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,a={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof r?new r(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);F+=S.value.length,S=S.next){var P=S.value;if(t.length>e.length)return;if(!(P instanceof r)){var w,A=1;if(b){if(!(w=o(k,F,e,y))||w.index>=e.length)break;var M=w.index,C=w.index+w[0].length,R=F;for(R+=S.value.length;M>=R;)R+=(S=S.next).value.length;if(F=R-=S.value.length,S.value instanceof r)continue;for(var T=S;T!==t.tail&&(Rd.reach&&(d.reach=D);var O=S.prev;if(L&&(O=c(t,O,L),F+=L.length),u(t,O,A),S=c(t,O,new r(p,f?i.tokenize(E,f):E,v,E)),I&&c(t,S,I),A>1){var B={cause:p+","+g,reach:D};s(e,t,n,S.prev,F,B),d&&B.reach>d.reach&&(d.reach=B.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var a=t.next,i={value:n,prev:t,next:a};return t.next=i,a.prev=i,e.length++,i}function u(e,t,n){for(var a=t.next,i=0;i"+r.content+""},!e.document)return e.addEventListener?(i.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),a=n.language,r=n.code,o=n.immediateClose;e.postMessage(i.highlight(r,i.languages[a],a)),o&&e.close()}),!1),i):i;var d=i.util.currentScript();function p(){i.manual||i.highlightAll()}if(d&&(i.filename=d.src,d.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var m=document.readyState;"loading"===m||"interactive"===m&&d&&d.defer?document.addEventListener("DOMContentLoaded",p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=a),void 0!==n.g&&(n.g.Prism=a),a.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},a.languages.markup.tag.inside["attr-value"].inside.entity=a.languages.markup.entity,a.languages.markup.doctype.inside["internal-subset"].inside=a.languages.markup,a.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(a.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:a.languages[t]},n.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:n}};i["language-"+t]={pattern:/[\s\S]+/,inside:a.languages[t]};var r={};r[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:i},a.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(a.languages.markup.tag,"addAttribute",{value:function(e,t){a.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:a.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),a.languages.html=a.languages.markup,a.languages.mathml=a.languages.markup,a.languages.svg=a.languages.markup,a.languages.xml=a.languages.extend("markup",{}),a.languages.ssml=a.languages.xml,a.languages.atom=a.languages.xml,a.languages.rss=a.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(a),a.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},a.languages.javascript=a.languages.extend("clike",{"class-name":[a.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),a.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,a.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:a.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:a.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:a.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:a.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:a.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),a.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:a.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),a.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),a.languages.markup&&(a.languages.markup.tag.addInlined("script","javascript"),a.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),a.languages.js=a.languages.javascript,function(){if(void 0!==a&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",i="loaded",r="pre[data-src]:not(["+t+'="'+i+'"]):not(['+t+'="'+n+'"])';a.hooks.add("before-highlightall",(function(e){e.selector+=", "+r})),a.hooks.add("before-sanity-check",(function(o){var s=o.element;if(s.matches(r)){o.code="",s.setAttribute(t,n);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=s.getAttribute("data-src"),u=o.language;if("none"===u){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[d]||d}a.util.setLanguage(l,u),a.util.setLanguage(s,u);var p=a.plugins.autoloader;p&&p.loadLanguages(u),function(e,n,r){var o=new XMLHttpRequest;o.open("GET",e,!0),o.onreadystatechange=function(){4==o.readyState&&(o.status<400&&o.responseText?function(e){s.setAttribute(t,i);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),a=t[2],i=t[3];return a?i?[n,Number(i)]:[n,void 0]:[n,n]}}(s.getAttribute("data-range"));if(n){var r=e.split(/\r\n?|\n/g),o=n[0],c=null==n[1]?r.length:n[1];o<0&&(o+=r.length),o=Math.max(0,Math.min(o-1,r.length)),c<0&&(c+=r.length),c=Math.max(0,Math.min(c,r.length)),e=r.slice(o,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(o+1))}l.textContent=e,a.highlightElement(l)}(o.responseText):o.status>=400?r("✖ Error "+o.status+" while fetching file: "+o.statusText):r("✖ Error: File does not exist or is empty"))},o.send(null)}(c,0,(function(e){s.setAttribute(t,"failed"),l.textContent=e}))}})),a.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(r),i=0;t=n[i++];)a.highlightElement(t)}};var o=!1;a.fileHighlight=function(){o||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),o=!0),a.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},72:e=>{"use strict";var t=[];function n(e){for(var n=-1,a=0;a{"use strict";var t={};e.exports=function(e,n){var a=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},56:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var a="";n.supports&&(a+="@supports (".concat(n.supports,") {")),n.media&&(a+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(a+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),a+=n.css,i&&(a+="}"),n.media&&(a+="}"),n.supports&&(a+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(a,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var r=t[a]={id:a,exports:{}};return e[a](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0,(()=>{"use strict";n(848),n(432);var e=n(72),t=n.n(e),a=n(825),i=n.n(a),r=n(659),o=n.n(r),s=n(56),l=n.n(s),c=n(540),u=n.n(c),d=n(113),p=n.n(d),m=n(415),g={};g.styleTagTransform=p(),g.setAttributes=l(),g.insert=o().bind(null,"head"),g.domAPI=i(),g.insertStyleElement=u(),t()(m.A,g),m.A&&m.A.locals&&m.A.locals})()})(); \ No newline at end of file +(()=>{var e={432:()=>{Prism.languages.m2=Prism.languages.macaulay2={comment:[{pattern:/(^|[^\\])\-\*[\s\S]*?(?:\*\-|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\-\-.*/,lookbehind:!0,greedy:!0}],string:[{pattern:/"(?:\\[\s\S]|(?!")[^\\])*"/,greedy:!0},{pattern:/\/\/\/(\/(?!\/)|(?:\/\/)+(?!\/)|[^\/])*(?:\/\/)+\/(?!\/)/,greedy:!0}],keyword:/\b(?:SPACE|TEST|and|break|catch|continue|do|elapsedTime|elapsedTiming|else|for|from|global|if|in|list|local|new|not|of|or|return|shield|step|symbol|then|threadLocal|threadVariable|throw|time|timing|to|try|when|while|xor)\b/,"class-name":/\b(?:ANCHOR|Adjacent|AffineVariety|Analyzer|AngleBarList|Array|AssociativeExpression|AtomicInt|BLOCKQUOTE|BODY|BOLD|BR|BUTTON|Bag|BasicList|BettiTally|BinaryOperation|Boolean|CC|CDATA|CODE|COMMENT|CacheFunction|CacheTable|ChainComplex|ChainComplexMap|CoherentSheaf|Command|CompiledFunction|CompiledFunctionBody|CompiledFunctionClosure|ComplexField|Constant|DD|DIV|DL|DT|Database|Descent|Describe|Dictionary|DirectSum|Divide|DocumentTag|EM|Eliminate|EngineRing|Equation|ExampleItem|Expression|File|FilePosition|FractionField|Function|FunctionApplication|FunctionBody|FunctionClosure|GaloisField|GeneralOrderedMonoid|GlobalDictionary|GradedModule|GradedModuleMap|GroebnerBasis|GroebnerBasisOptions|HEAD|HEADER1|HEADER2|HEADER3|HEADER4|HEADER5|HEADER6|HR|HREF|HTML|HashTable|HeaderType|Holder|Hybrid|Hypertext|HypertextContainer|HypertextParagraph|HypertextVoid|IMG|INDENT|INPUT|ITALIC|Ideal|ImmutableType|IndeterminateNumber|IndexedVariable|IndexedVariableTable|InexactField|InexactFieldFamily|InexactNumber|InfiniteNumber|IntermediateMarkUpType|Iterator|KBD|Keyword|LABEL|LATER|LI|LINK|LITERAL|List|LocalDictionary|LowerBound|MENU|META|Manipulator|MapExpression|MarkUpType|Matrix|MatrixExpression|MethodFunction|MethodFunctionBinary|MethodFunctionSingle|MethodFunctionWithOptions|Minus|Module|Monoid|MonoidElement|MonomialIdeal|MultigradedBettiTally|MutableHashTable|MutableList|MutableMatrix|Net|NetFile|Nothing|Number|NumberedVerticalList|OL|OneExpression|Option|OptionTable|OrderedMonoid|PARA|PRE|Package|Parenthesize|Parser|Partition|PolynomialRing|Power|Product|ProductOrder|Program|ProgramRun|ProjectiveHilbertPolynomial|ProjectiveVariety|Pseudocode|PseudocodeClosure|QQ|QuotientRing|RR|RRi|RealField|Resolution|Ring|RingElement|RingFamily|RingMap|RowExpression|SAMP|SCRIPT|SMALL|SPAN|STRONG|STYLE|SUB|SUBSECTION|SUP|ScriptedFunctor|SelfInitializingType|Sequence|Set|SheafExpression|SheafMap|SheafOfRings|SparseMonomialVectorExpression|SparseVectorExpression|String|Subscript|Sum|SumOfTwists|Superscript|Symbol|SymbolBody|TABLE|TD|TEX|TH|TITLE|TO|TO2|TOH|TR|TT|Table|Tally|Task|TensorProduct|TestInput|Thing|Time|Type|UL|URL|VAR|Variety|Vector|VectorExpression|VerticalList|VirtualTally|VisibleList|WrapperType|ZZ|ZeroExpression)\b/,function:/\b(?:BesselJ|BesselY|Beta|Digamma|EXAMPLE|End|Fano|GCstats|GF|Gamma|Grassmannian|Hom|LLL|LUdecomposition|M2CODE|NNParser|Proj|QQParser|QRDecomposition|SVD|SYNOPSIS|Schubert|Spec|ZZParser|about|abs|accumulate|acos|acosh|acot|acoth|addCancelTask|addDependencyTask|addEndFunction|addHook|addStartTask|adjoint|agm|alarm|all|ambient|analyticSpread|ancestor|ancestors|andP|ann|annihilator|antipode|any|append|applicationDirectory|apply|applyKeys|applyPairs|applyTable|applyValues|apropos|arXiv|ascii|asin|asinh|ass|assert|associatedGradedRing|associatedPrimes|atEndOfFile|atan|atan2|atanh|autoload|baseFilename|baseName|baseRing|basis|beginDocumentation|benchmark|betti|between|binomial|borel|cacheValue|cancelTask|canonicalBundle|capture|ceiling|centerString|chainComplex|changeBase|changeDirectory|char|charAnalyzer|characters|check|checkDegrees|chi|class|clean|clearEcho|code|codim|coefficient|coefficientRing|coefficients|cohomology|coimage|coker|cokernel|collectGarbage|columnAdd|columnMult|columnPermute|columnRankProfile|columnSwap|columnate|combine|commandInterpreter|commonRing|commonest|comodule|compareExchange|complement|complete|components|compose|compositions|compress|concatenate|conductor|cone|conjugate|connectionCount|constParser|content|contract|conwayPolynomial|copy|copyDirectory|copyFile|cos|cosh|cot|cotangentSheaf|coth|cover|coverMap|cpuTime|createTask|csc|csch|currentColumnNumber|currentDirectory|currentPosition|currentRowNumber|currentTime|deadParser|debug|debugError|decompose|deepSplice|default|degree|degreeGroup|degreeLength|degrees|degreesMonoid|degreesRing|delete|demark|denominator|depth|describe|det|determinant|diagonalMatrix|diameter|dictionary|diff|difference|dim|directSum|disassemble|discriminant|dismiss|distinguished|divideByVariable|doc|document|drop|dual|eagonNorthcott|echoOff|echoOn|eigenvalues|eigenvectors|eint|elements|eliminate|endPackage|entries|erase|erf|erfc|error|euler|eulers|even|examples|exchange|exec|exp|expectedReesIdeal|expm1|exponents|export|exportFrom|exportMutable|expression|extend|exteriorPower|factor|fileExecutable|fileExists|fileLength|fileMode|fileReadable|fileTime|fileWritable|fillMatrix|findFiles|findHeft|findProgram|findSynonyms|first|firstkey|fittingIdeal|flagLookup|flatten|flattenRing|flip|floor|fold|forceGB|fork|format|formation|frac|fraction|frames|fromDividedPowers|fromDual|functionBody|futureParser|gb|gbRemove|gbSnapshot|gcd|gcdCoefficients|gcdLLL|genera|generateAssertions|generator|generators|genericMatrix|genericSkewMatrix|genericSymmetricMatrix|gens|genus|get|getChangeMatrix|getGlobalSymbol|getIOThreadMode|getNetFile|getNonUnit|getPrimeWithRootOfUnity|getSymbol|getWWW|getc|getenv|globalAssign|globalAssignFunction|globalAssignment|globalReleaseFunction|gradedModule|gradedModuleMap|gramm|graphIdeal|graphRing|groebnerBasis|groupID|hash|hashTable|headlines|heft|height|hermite|hilbertFunction|hilbertPolynomial|hilbertSeries|hold|homogenize|homology|homomorphism|hooks|horizontalJoin|html|httpHeaders|hypertext|icFracP|icFractions|icMap|icPIdeal|ideal|idealizer|identity|image|imaginaryPart|importFrom|independentSets|index|indices|inducedMap|inducesWellDefinedMap|info|input|insert|installAssignmentMethod|installHilbertFunction|installMethod|installMinprimes|installPackage|installedPackages|instance|instances|integralClosure|integrate|intersect|intersectInP|intersection|interval|inverse|inverseErf|inversePermutation|inverseRegularizedBeta|inverseRegularizedGamma|inverseSystem|irreducibleCharacteristicSeries|irreducibleDecomposition|isANumber|isAffineRing|isBorel|isCanceled|isCommutative|isConstant|isDirectSum|isDirectory|isEmpty|isField|isFinite|isFinitePrimeField|isFreeModule|isGlobalSymbol|isHomogeneous|isIdeal|isInfinite|isInjective|isInputFile|isIsomorphic|isIsomorphism|isLLL|isLiftable|isLinearType|isListener|isMember|isModule|isMonomialIdeal|isMutable|isNormal|isOpen|isOutputFile|isPolynomialRing|isPrimary|isPrime|isPrimitive|isProjective|isPseudoprime|isQuotientModule|isQuotientOf|isQuotientRing|isReady|isReal|isReduction|isRegularFile|isRing|isSkewCommutative|isSmooth|isSorted|isSquareFree|isStandardGradedPolynomialRing|isSubmodule|isSubquotient|isSubset|isSupportedInZeroLocus|isSurjective|isTable|isUnit|isVeryAmple|isWellDefined|isWeylAlgebra|isc|iterator|jacobian|jacobianDual|join|ker|kernel|kernelLLL|kernelOfLocalization|keys|kill|koszul|last|lcm|leadCoefficient|leadComponent|leadMonomial|leadTerm|left|length|letterParser|lift|liftable|limitFiles|limitProcesses|lines|linkFile|listForm|listSymbols|lngamma|load|loadPackage|localDictionaries|localize|locate|log|log1p|lookup|lookupCount|makeDirectory|makeDocumentTag|makePackageIndex|makeS2|map|markedGB|match|mathML|matrix|max|maxPosition|member|memoize|memoizeClear|memoizeValues|merge|mergePairs|method|methodOptions|methods|midpoint|min|minPosition|minPres|mingens|mingle|minimalBetti|minimalPresentation|minimalPrimes|minimalReduction|minimize|minimizeFilename|minors|minprimes|minus|mkdir|mod|module|modulo|monoid|monomialCurveIdeal|monomialIdeal|monomialSubideal|monomials|moveFile|multidegree|multidoc|multigraded|multiplicity|mutable|mutableIdentity|mutableMatrix|nanosleep|needs|needsPackage|net|netList|newClass|newCoordinateSystem|newNetFile|newPackage|newRing|next|nextPrime|nextkey|nonspaceAnalyzer|norm|normalCone|notImplemented|nullParser|nullSpace|nullhomotopy|numColumns|numRows|number|numcols|numerator|numeric|numericInterval|numgens|numrows|odd|oeis|ofClass|on|openDatabase|openDatabaseOut|openFiles|openIn|openInOut|openListener|openOut|openOutAppend|optP|optionalSignParser|options|orP|override|pack|package|packageTemplate|pad|pager|pairs|parallelApply|parent|part|partition|partitions|parts|pdim|peek|permanents|permutations|pfaffians|pivots|plus|poincare|poincareN|polarize|poly|position|positions|power|powermod|precision|preimage|prepend|presentation|pretty|primaryComponent|primaryDecomposition|print|printString|printerr|processID|product|profile|projectiveHilbertPolynomial|promote|protect|prune|pseudoRemainder|pseudocode|pullback|pushForward|pushout|quotient|quotientRemainder|radical|radicalContainment|random|randomKRationalPoint|randomMutableMatrix|rank|rays|read|readDirectory|readPackage|readlink|realPart|realpath|recursionDepth|reduceHilbert|reducedRowEchelonForm|reductionNumber|reesAlgebra|reesAlgebraIdeal|reesIdeal|regSeqInIdeal|regex|regexQuote|registerFinalizer|regularity|regularizedBeta|regularizedGamma|relations|relativizeFilename|remainder|remove|removeDirectory|removeFile|removeLowestDimension|reorganize|replace|res|reshape|resolution|resultant|reverse|right|ring|ringFromFractions|roots|rotate|round|rowAdd|rowMult|rowPermute|rowRankProfile|rowSwap|rsort|run|runHooks|runLengthEncode|runProgram|same|saturate|scan|scanKeys|scanLines|scanPairs|scanValues|schedule|schreyerOrder|searchPath|sec|sech|seeParsing|select|selectInSubring|selectKeys|selectPairs|selectValues|selectVariables|separate|separateRegexp|sequence|serialNumber|set|setEcho|setGroupID|setIOExclusive|setIOSynchronized|setIOUnSynchronized|setRandomSeed|setup|setupEmacs|setupLift|setupPromote|sheaf|sheafHom|sheafMap|show|showHtml|showTex|simpleDocFrob|sin|singularLocus|sinh|size|size2|sleep|smithNormalForm|solve|someTerms|sort|sortColumns|source|span|specialFiber|specialFiberIdeal|splice|splitWWW|sqrt|stack|stacksProject|standardForm|standardPairs|stashValue|status|store|style|sub|sublists|submatrix|submatrixByDegrees|subquotient|subsets|substitute|substring|subtable|sum|super|support|switch|sylvesterMatrix|symbolBody|symlinkDirectory|symlinkFile|symmetricAlgebra|symmetricAlgebraIdeal|symmetricKernel|symmetricPower|synonym|syz|syzygyScheme|table|take|tally|tan|tangentCone|tangentSheaf|tanh|target|taskResult|temporaryFileName|tensor|tensorAssociativity|terminalParser|terms|testHunekeQuestion|tests|tex|texMath|times|toAbsolutePath|toCC|toDividedPowers|toDual|toExternalString|toField|toList|toLower|toRR|toRRi|toSequence|toString|toUpper|top|topCoefficients|topComponents|trace|transpose|trim|truncate|truncateOutput|tutorial|ultimate|unbag|uncurry|undocumented|uniform|uninstallAllPackages|uninstallPackage|union|unique|uniquePermutations|unsequence|unstack|urlEncode|use|userSymbols|utf8|utf8check|utf8substring|validate|value|values|variety|vars|vector|versalEmbedding|wait|wedgeProduct|weightRange|whichGm|width|wikipedia|wrap|youngest|zero|zeta)\b/,constant:/\b(?:A1BrouwerDegrees|AbstractSimplicialComplexes|AbstractToricVarieties|Acknowledgement|AdditionalPaths|AdjointIdeal|AdjunctionForSurfaces|AfterEval|AfterNoPrint|AfterPrint|AInfinity|AlgebraicSplines|Algorithm|Alignment|AllCodimensions|allowableThreads|AnalyzeSheafOnP1|applicationDirectorySuffix|argument|Ascending|AssociativeAlgebras|Authors|AuxiliaryFiles|backtrace|Bareiss|Base|BaseFunction|baseRings|BaseRow|BasisElementLimit|Bayer|BeforePrint|BeginningMacaulay2|Benchmark|BernsteinSato|Bertini|BettiCharacters|BGG|BIBasis|Binary|Binomial|BinomialEdgeIdeals|Binomials|BKZ|blockMatrixForm|Body|BoijSoederberg|Book3264Examples|BooleanGB|Boxes|Browse|Bruns|cache|CacheExampleOutput|CallLimit|CannedExample|CatalanConstant|Caveat|CellularResolutions|Center|Certification|ChainComplexExtras|ChainComplexOperations|ChangeMatrix|CharacteristicClasses|CheckDocumentation|Chordal|cite|Classic|clearAll|clearOutput|close|closeIn|closeOut|ClosestFit|Code|CodimensionLimit|CodingTheory|CoefficientRing|Cofactor|CohenEngine|CohenTopLevel|CohomCalg|CoincidentRootLoci|commandLine|compactMatrixForm|Complement|CompleteIntersection|CompleteIntersectionResolutions|Complexes|ConductorElement|Configuration|ConformalBlocks|Consequences|Constants|Contributors|ConvexInterface|ConwayPolynomials|copyright|Core|CorrespondenceScrolls|CotangentSchubert|Cremona|currentFileDirectory|currentFileName|currentLayout|currentPackage|Cyclotomic|Date|dd|DebuggingMode|debuggingMode|debugLevel|DecomposableSparseSystems|Decompose|Default|defaultPrecision|Degree|DegreeGroup|DegreeLift|DegreeLimit|DegreeMap|DegreeOrder|DegreeRank|Degrees|Dense|Density|Depth|Descending|Description|DeterminantalRepresentations|DGAlgebras|dictionaryPath|DiffAlg|Dispatch|DivideConquer|DividedPowers|Divisor|Dmodules|docExample|docTemplate|Down|Dynamic|EagonResolution|EdgeIdeals|edit|EigenSolver|EisenbudHunekeVasconcelos|Elimination|EliminationMatrices|EllipticCurves|EllipticIntegrals|Email|end|endl|Engine|engineDebugLevel|EngineTests|EnumerationCurves|environment|EquivariantGB|errorDepth|EulerConstant|Example|ExampleFiles|ExampleSystems|Exclude|exit|Ext|ExteriorIdeals|ExteriorModules|false|FastMinors|FastNonminimal|FGLM|fileDictionaries|fileExitHooks|FileName|FindOne|FiniteFittingIdeals|First|FirstPackage|FlatMonoid|Flexible|flush|FollowLinks|ForeignFunctions|FormalGroupLaws|Format|FourierMotzkin|FourTiTwo|fpLLL|FrobeniusThresholds|FunctionFieldDesingularization|GBDegrees|gbTrace|GenerateAssertions|Generic|GenericInitialIdeal|GeometricDecomposability|gfanInterface|Givens|GKMVarieties|GLex|Global|GlobalAssignHook|globalAssignmentHooks|GlobalHookStore|GlobalReleaseHook|GlobalSectionLimit|Gorenstein|GradedLieAlgebras|GraphicalModels|GraphicalModelsMLE|Graphics|Graphs|GRevLex|GroebnerStrata|GroebnerWalk|GroupLex|GroupRevLex|GTZ|Hadamard|handleInterrupts|HardDegreeLimit|Heading|Headline|Heft|Height|help|Hermite|Hermitian|HH|hh|HigherCIOperators|HighestWeights|Hilbert|HodgeIntegrals|HolonomicSystems|homeDirectory|HomePage|Homogeneous|Homogeneous2|HomotopyLieAlgebra|HorizontalSpace|HyperplaneArrangements|id|IgnoreExampleErrors|ii|incomparable|Increment|indeterminate|Index|indexComponents|infinity|InfoDirSection|infoHelp|Inhomogeneous|Inputs|InstallPrefix|IntegralClosure|interpreterDepth|Intersection|InvariantRing|InverseMethod|Inverses|InverseSystems|Invertible|InvolutiveBases|Isomorphism|Item|Iterate|Jacobian|Jets|Join|JSON|Jupyter|K3Carpets|K3Surfaces|Keep|KeepFiles|KeepZeroes|Key|Keywords|Kronecker|KustinMiller|lastMatch|LatticePolytopes|Layout|Left|LengthLimit|Lex|LexIdeals|Licenses|LieTypes|Limit|Linear|LinearAlgebra|LinearTruncations|lineNumber|listLocalSymbols|listUserSymbols|LLLBases|loadDepth|LoadDocumentation|loadedFiles|loadedPackages|Local|LocalRings|LongPolynomial|M0nbar|Macaulay2Doc|Maintainer|MakeDocumentation|MakeHTML|MakeInfo|MakeLinks|MakePDF|MapleInterface|Markov|MatchingFields|MatrixSchubert|Matroids|maxAllowableThreads|maxExponent|MaximalRank|MaxReductionCount|MCMApproximations|MergeTeX|minExponent|MinimalGenerators|MinimalMatrix|minimalPresentationMap|minimalPresentationMapInv|MinimalPrimes|Minimize|MinimumVersion|Miura|MixedMultiplicity|ModuleDeformations|MonodromySolver|Monomial|MonomialAlgebras|MonomialIntegerPrograms|MonomialOrbits|MonomialOrder|Monomials|MonomialSize|Msolve|MultigradedBGG|MultigradedImplicitization|MultiGradedRationalMap|MultiplicitySequence|MultiplierIdeals|MultiplierIdealsDim2|MultiprojectiveVarieties|NAGtypes|Name|Nauty|NautyGraphs|NCAlgebra|NCLex|NewFromMethod|newline|NewMethod|NewOfFromMethod|NewOfMethod|nil|Node|NoetherianOperators|NoetherNormalization|NonminimalComplexes|NoPrint|Normaliz|NormalToricVarieties|notify|NTL|null|nullaryMethods|NumericalAlgebraicGeometry|NumericalCertification|NumericalImplicitization|NumericalLinearAlgebra|NumericalSchubertCalculus|NumericalSemigroups|NumericSolutions|numTBBThreads|OIGroebnerBases|OldPolyhedra|OldToricVectorBundles|OnlineLookup|OO|oo|ooo|oooo|OpenMath|operatorAttributes|OptionalComponentsPresent|Options|Order|order|OutputDictionary|Outputs|PackageCitations|PackageDictionary|PackageExports|PackageImports|PackageTemplate|PairLimit|PairsRemaining|ParallelF4|ParallelizeByDegree|Parametrization|Parsing|path|PencilsOfQuadrics|Permanents|Permutations|PHCpack|PhylogeneticTrees|pi|PieriMaps|PlaneCurveLinearSeries|PlaneCurveSingularities|Points|Polyhedra|Polymake|PolyominoIdeals|Posets|Position|PositivityToricBundles|POSIX|Postfix|Pre|Precision|Prefix|prefixDirectory|prefixPath|PrimaryDecomposition|PrimaryTag|PrimitiveElement|Print|printingAccuracy|printingLeadLimit|printingPrecision|printingSeparator|printingTimeLimit|printingTrailLimit|printWidth|Probability|profileSummary|programPaths|Projective|Prune|PruneComplex|pruningMap|PseudomonomialPrimaryDecomposition|Pullback|pullbackMaps|PushForward|pushoutMaps|Python|QthPower|QuadraticIdealExamplesByRoos|Quasidegrees|QuaternaryQuartics|QuillenSuslin|quit|Quotient|Radical|RadicalCodim1|RaiseError|RandomCanonicalCurves|RandomComplexes|RandomCurves|RandomCurvesOverVerySmallFiniteFields|RandomGenus14Curves|RandomIdeals|RandomMonomialIdeals|RandomObjects|RandomPlaneCurves|RandomPoints|RandomSpaceCurves|Range|RationalMaps|RationalPoints|RationalPoints2|ReactionNetworks|RealFP|RealQP|RealQP1|RealRoots|RealRR|RealXD|recursionLimit|Reduce|ReesAlgebra|References|ReflexivePolytopesDB|Regularity|RelativeCanonicalResolution|Reload|RemakeAllDocumentation|RerunExamples|ResidualIntersections|ResLengthThree|ResolutionsOfStanleyReisnerRings|restart|Result|Resultants|returnCode|Reverse|RevLex|Right|RInterface|rootPath|rootURI|RunDirectory|RunExamples|RunExternalM2|SagbiGbDetection|Saturation|SaturationMap|Schubert2|SchurComplexes|SchurFunctors|SchurRings|SchurVeronese|SCMAlgebras|scriptCommandLine|SCSCP|SectionRing|SeeAlso|SegreClasses|SemidefiniteProgramming|Seminormalization|SeparateExec|Serialization|sheafExt|ShimoyamaYokoyama|showClassStructure|showStructure|showUserStructure|SimpleDoc|SimplicialComplexes|SimplicialDecomposability|SimplicialPosets|SimplifyFractions|SizeLimit|SkewCommutative|SlackIdeals|SLnEquivariantMatrices|SLPexpressions|Sort|SortStrategy|SourceCode|SourceRing|SpaceCurves|SparseResultants|SpechtModule|SpecialFanoFourfolds|SpectralSequences|SRdeformations|Standard|StartWithOneMinor|StatePolytope|StatGraphs|stderr|stdio|StopBeforeComputation|stopIfError|StopIteration|StopWithMinimalGenerators|Strategy|Strict|StronglyStableIdeals|Style|SubalgebraBases|Subnodes|SubringLimit|subscript|Sugarless|SumsOfSquares|SuperLinearAlgebra|superscript|SVDComplexes|SwitchingFields|SymbolicPowers|SymmetricPolynomials|Synopsis|Syzygies|SyzygyLimit|SyzygyMatrix|SyzygyRows|TangentCone|TateOnProducts|TensorComplexes|TerraciniLoci|Test|testExample|TestIdeals|TeXmacs|Text|ThinSincereQuivers|ThreadedGB|Threads|Threshold|Topcom|topLevelMode|Tor|TorAlgebra|Toric|ToricInvariants|ToricTopology|ToricVectorBundles|Torsion|TorsionFree|TotalPairs|Tree|TriangularSets|Triangulations|Tries|Trim|Triplets|Tropical|TropicalToric|true|Truncate|Truncations|TSpreadIdeals|TypicalValue|typicalValues|Undo|Unique|Units|Unmixed|Up|UpdateOnly|UpperTriangular|Usage|UseCachedExampleOutput|UseHilbertFunction|UserMode|UseSyzygies|Valuations|Variable|VariableBaseName|Variables|Varieties|Vasconcelos|VectorFields|VectorGraphics|Verbose|Verbosity|Verify|VersalDeformations|Version|version|VerticalSpace|viewHelp|VirtualResolutions|Visualize|VNumber|WebApp|Weights|WeylAlgebra|WeylAlgebras|WeylGroups|WhitneyStratifications|Wrap|XML)\b/}},415:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var a=n(601),i=n.n(a),r=n(314),o=n.n(r)()(i());o.push([e.id,'/* PrismJS 1.14.0\nhttp://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */\n/**\n * prism.js theme for Macaulay2\n 2018 P. Zinn-Justin\n */\n\n/*\ncode[class*="language-"],\npre[class*="language-"] {\n\tcolor: black;\n\tbackground: none;\n\ttext-shadow: 0 1px white;\n\tfont-family: Consolas, Monaco, \'Andale Mono\', \'Ubuntu Mono\', monospace;\n\ttext-align: left;\n\twhite-space: pre;\n\tword-spacing: normal;\n\tword-break: normal;\n\tword-wrap: normal;\n\tline-height: 1.5;\n\n\t-moz-tab-size: 4;\n\t-o-tab-size: 4;\n\ttab-size: 4;\n\n\t-webkit-hyphens: none;\n\t-moz-hyphens: none;\n\t-ms-hyphens: none;\n\thyphens: none;\n}\n\npre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,\ncode[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {\n\ttext-shadow: none;\n\tbackground: #b3d4fc;\n}\n\npre[class*="language-"]::selection, pre[class*="language-"] ::selection,\ncode[class*="language-"]::selection, code[class*="language-"] ::selection {\n\ttext-shadow: none;\n\tbackground: #b3d4fc;\n}\n\n@media print {\n\tcode[class*="language-"],\n\tpre[class*="language-"] {\n\t\ttext-shadow: none;\n\t}\n}\n*/\n/* Code blocks */\n/*\npre[class*="language-"] {\n\tpadding: 1em;\n\tmargin: .5em 0;\n\toverflow: auto;\n}\n\n:not(pre) > code[class*="language-"],\npre[class*="language-"] {\n\tbackground: #f5f2f0;\n}\n*/\n/* Inline code */\n/*\n:not(pre) > code[class*="language-"] {\n\tpadding: .1em;\n\tborder-radius: .3em;\n\twhite-space: normal;\n}\n*/\n.token.comment {\n color: #607080;\n}\n\n/*\n.token.punctuation {\n\tcolor: #999;\n}\n\n.namespace {\n\topacity: .7;\n}\n*/\n\n.token.constant {\n /*\tcolor: #008b8b; */\n color: #004060;\n}\n\n.token.net,\n.token.string {\n\tcolor: #8b2252;\n}\n\n/*\n.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string {\n\tcolor: #9a6e3a;\n\tbackground: hsla(0, 0%, 100%, .5);\n}\n*/\n\n.token.keyword {\n color: #a020f0;\n}\n\n.token.function {\n color: #0000ff;\n}\n.token.class-name {\n /* color: #228b22; */\n color: #1c701c;\n}\n\n/*\n.token.regex,\n.token.important,\n.token.variable {\n\tcolor: #e90;\n}\n\n.token.important,\n.token.bold {\n\tfont-weight: bold;\n}\n.token.italic {\n\tfont-style: italic;\n}\n\n.token.entity {\n\tcursor: help;\n}\n*/\n',""]);const s=o},314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",a=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),a&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),a&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,a,i,r){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(a)for(var s=0;s0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=r),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},601:e=>{"use strict";e.exports=function(e){return e[1]}},848:(e,t,n)=>{var a=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,a={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof r?new r(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);F+=k.value.length,k=k.next){var P=k.value;if(t.length>e.length)return;if(!(P instanceof r)){var A,w=1;if(b){if(!(A=o(S,F,e,y))||A.index>=e.length)break;var M=A.index,C=A.index+A[0].length,R=F;for(R+=k.value.length;M>=R;)R+=(k=k.next).value.length;if(F=R-=k.value.length,k.value instanceof r)continue;for(var T=k;T!==t.tail&&(Rd.reach&&(d.reach=D);var O=k.prev;if(L&&(O=c(t,O,L),F+=L.length),u(t,O,w),k=c(t,O,new r(p,f?i.tokenize(E,f):E,v,E)),I&&c(t,k,I),w>1){var B={cause:p+","+g,reach:D};s(e,t,n,k.prev,F,B),d&&B.reach>d.reach&&(d.reach=B.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var a=t.next,i={value:n,prev:t,next:a};return t.next=i,a.prev=i,e.length++,i}function u(e,t,n){for(var a=t.next,i=0;i"+r.content+""},!e.document)return e.addEventListener?(i.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),a=n.language,r=n.code,o=n.immediateClose;e.postMessage(i.highlight(r,i.languages[a],a)),o&&e.close()}),!1),i):i;var d=i.util.currentScript();function p(){i.manual||i.highlightAll()}if(d&&(i.filename=d.src,d.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var m=document.readyState;"loading"===m||"interactive"===m&&d&&d.defer?document.addEventListener("DOMContentLoaded",p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=a),void 0!==n.g&&(n.g.Prism=a),a.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},a.languages.markup.tag.inside["attr-value"].inside.entity=a.languages.markup.entity,a.languages.markup.doctype.inside["internal-subset"].inside=a.languages.markup,a.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(a.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:a.languages[t]},n.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:n}};i["language-"+t]={pattern:/[\s\S]+/,inside:a.languages[t]};var r={};r[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:i},a.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(a.languages.markup.tag,"addAttribute",{value:function(e,t){a.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:a.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),a.languages.html=a.languages.markup,a.languages.mathml=a.languages.markup,a.languages.svg=a.languages.markup,a.languages.xml=a.languages.extend("markup",{}),a.languages.ssml=a.languages.xml,a.languages.atom=a.languages.xml,a.languages.rss=a.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(a),a.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},a.languages.javascript=a.languages.extend("clike",{"class-name":[a.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),a.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,a.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:a.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:a.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:a.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:a.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:a.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),a.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:a.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),a.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),a.languages.markup&&(a.languages.markup.tag.addInlined("script","javascript"),a.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),a.languages.js=a.languages.javascript,function(){if(void 0!==a&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",i="loaded",r="pre[data-src]:not(["+t+'="'+i+'"]):not(['+t+'="'+n+'"])';a.hooks.add("before-highlightall",(function(e){e.selector+=", "+r})),a.hooks.add("before-sanity-check",(function(o){var s=o.element;if(s.matches(r)){o.code="",s.setAttribute(t,n);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=s.getAttribute("data-src"),u=o.language;if("none"===u){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[d]||d}a.util.setLanguage(l,u),a.util.setLanguage(s,u);var p=a.plugins.autoloader;p&&p.loadLanguages(u),function(e,n,r){var o=new XMLHttpRequest;o.open("GET",e,!0),o.onreadystatechange=function(){4==o.readyState&&(o.status<400&&o.responseText?function(e){s.setAttribute(t,i);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),a=t[2],i=t[3];return a?i?[n,Number(i)]:[n,void 0]:[n,n]}}(s.getAttribute("data-range"));if(n){var r=e.split(/\r\n?|\n/g),o=n[0],c=null==n[1]?r.length:n[1];o<0&&(o+=r.length),o=Math.max(0,Math.min(o-1,r.length)),c<0&&(c+=r.length),c=Math.max(0,Math.min(c,r.length)),e=r.slice(o,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(o+1))}l.textContent=e,a.highlightElement(l)}(o.responseText):o.status>=400?r("✖ Error "+o.status+" while fetching file: "+o.statusText):r("✖ Error: File does not exist or is empty"))},o.send(null)}(c,0,(function(e){s.setAttribute(t,"failed"),l.textContent=e}))}})),a.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(r),i=0;t=n[i++];)a.highlightElement(t)}};var o=!1;a.fileHighlight=function(){o||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),o=!0),a.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},72:e=>{"use strict";var t=[];function n(e){for(var n=-1,a=0;a{"use strict";var t={};e.exports=function(e,n){var a=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},56:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var a="";n.supports&&(a+="@supports (".concat(n.supports,") {")),n.media&&(a+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(a+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),a+=n.css,i&&(a+="}"),n.media&&(a+="}"),n.supports&&(a+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(a,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var r=t[a]={id:a,exports:{}};return e[a](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0,(()=>{"use strict";n(848),n(432);var e=n(72),t=n.n(e),a=n(825),i=n.n(a),r=n(659),o=n.n(r),s=n(56),l=n.n(s),c=n(540),u=n.n(c),d=n(113),p=n.n(d),m=n(415),g={};g.styleTagTransform=p(),g.setAttributes=l(),g.insert=o().bind(null,"head"),g.domAPI=i(),g.insertStyleElement=u(),t()(m.A,g),m.A&&m.A.locals&&m.A.locals})()})(); \ No newline at end of file From d6bbbb1d5177d67792a660289255814c87c3962f Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 21:01:57 -0400 Subject: [PATCH 212/226] Add prism package-lock.json to git According to the npm documentation, it should be commited. --- M2/Macaulay2/editors/prism/package-lock.json | 1568 ++++++++++++++++++ 1 file changed, 1568 insertions(+) create mode 100644 M2/Macaulay2/editors/prism/package-lock.json diff --git a/M2/Macaulay2/editors/prism/package-lock.json b/M2/Macaulay2/editors/prism/package-lock.json new file mode 100644 index 00000000000..02fff8ad60f --- /dev/null +++ b/M2/Macaulay2/editors/prism/package-lock.json @@ -0,0 +1,1568 @@ +{ + "name": "prism", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "prismjs": "^1.29.0" + }, + "devDependencies": { + "css-loader": "^7.1.2", + "style-loader": "^4.0.0", + "webpack": "^5.75.0", + "webpack-cli": "^5.0.1" + } + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "22.8.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.6.tgz", + "integrity": "sha512-tosuJYKrIqjQIlVCM4PEGxOmyg3FCPa/fViuJChnGeEIhjA46oy8FMVoF9su1/v8PNs2a8Q0iFNyOx0uOF91nw==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.8" + } + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", + "dev": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "dev": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.12.1" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "dev": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "dev": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "dev": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.12.1", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webpack-cli/configtest": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz", + "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz", + "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/serve": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz", + "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/browserslist": { + "version": "4.24.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", + "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001669", + "electron-to-chromium": "^1.5.41", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001676", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001676.tgz", + "integrity": "sha512-Qz6zwGCiPghQXGJvgQAem79esjitvJ+CxSbSQkW9H/UX5hg8XM88d4lp2W+MEQ81j+Hip58Il+jGVdazk1z9cw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chrome-trace-event": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", + "dev": true, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-loader": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-7.1.2.tgz", + "integrity": "sha512-6WvYYn7l/XEGN8Xu2vWFt9nVzrCn39vKyTEFf/ExEyoksJjjSZV/0/35XPlMbpnr6VGhZIUg5yJrL8tGfes/FA==", + "dev": true, + "dependencies": { + "icss-utils": "^5.1.0", + "postcss": "^8.4.33", + "postcss-modules-extract-imports": "^3.1.0", + "postcss-modules-local-by-default": "^4.0.5", + "postcss-modules-scope": "^3.2.0", + "postcss-modules-values": "^4.0.0", + "postcss-value-parser": "^4.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "webpack": "^5.27.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.50", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.50.tgz", + "integrity": "sha512-eMVObiUQ2LdgeO1F/ySTXsvqvxb6ZH2zPGaMYsWzRDdOddUa77tdmI0ltg+L16UpbWdhPmuF3wIQYyQq65WfZw==", + "dev": true + }, + "node_modules/enhanced-resolve": { + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/envinfo": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.14.0.tgz", + "integrity": "sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", + "dev": true + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/icss-utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/interpret": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/loader-runner": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "dev": true, + "engines": { + "node": ">=6.11.5" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "dev": true + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/postcss": { + "version": "8.4.47", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", + "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.1.0", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-modules-extract-imports": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", + "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-local-by-default": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.5.tgz", + "integrity": "sha512-6MieY7sIfTK0hYfafw1OMEG+2bg8Q1ocHCpoWLqOKj3JXlKu4G7btkmM/B7lFubYkYWmRSPLZi5chid63ZaZYw==", + "dev": true, + "dependencies": { + "icss-utils": "^5.0.0", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.1.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-scope": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.0.tgz", + "integrity": "sha512-oq+g1ssrsZOsx9M96c5w8laRmvEu9C3adDSjI8oTcbfkrTE8hx/zfyobUoWIxaKPO8bt6S62kxpw5GqypEw1QQ==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.4" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", + "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", + "dev": true, + "dependencies": { + "icss-utils": "^5.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true + }, + "node_modules/prismjs": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "engines": { + "node": ">=6" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/rechoir": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "dev": true, + "dependencies": { + "resolve": "^1.20.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/style-loader": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-4.0.0.tgz", + "integrity": "sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==", + "dev": true, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.27.0" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser": { + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", + "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", + "dev": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.20", + "jest-worker": "^27.4.5", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.1", + "terser": "^5.26.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, + "node_modules/update-browserslist-db": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", + "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/watchpack": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", + "dev": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack": { + "version": "5.96.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.0.tgz", + "integrity": "sha512-gvn84AfQ4f6vUeNWmFuRp3vGERyxK4epADKTaAo60K0EQbY/YBNQbXH3Ji/ZRK5M25O/XneAOuChF4xQZjQ4xA==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.6", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-cli": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", + "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", + "dev": true, + "dependencies": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^2.1.1", + "@webpack-cli/info": "^2.0.2", + "@webpack-cli/serve": "^2.0.5", + "colorette": "^2.0.14", + "commander": "^10.0.1", + "cross-spawn": "^7.0.3", + "envinfo": "^7.7.3", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^3.1.1", + "rechoir": "^0.8.0", + "webpack-merge": "^5.7.3" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "5.x.x" + }, + "peerDependenciesMeta": { + "@webpack-cli/generators": { + "optional": true + }, + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/webpack-cli/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/webpack-merge": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", + "integrity": "sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==", + "dev": true, + "dependencies": { + "clone-deep": "^4.0.1", + "flat": "^5.0.2", + "wildcard": "^2.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wildcard": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", + "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", + "dev": true + } + } +} From 0065bdf2aba355e1f8ac5a5556eadb9f518524d5 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 20:50:02 -0400 Subject: [PATCH 213/226] Add more generated files to editors directory .gitignore --- M2/Macaulay2/editors/.gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/M2/Macaulay2/editors/.gitignore b/M2/Macaulay2/editors/.gitignore index 7f502521e8c..4a72c90f831 100644 --- a/M2/Macaulay2/editors/.gitignore +++ b/M2/Macaulay2/editors/.gitignore @@ -2,7 +2,12 @@ emacs/M2-emacs-hlp.txt emacs/M2-emacs.m2 emacs/M2-symbols.el highlightjs/macaulay2.js +Macaulay2Web/M2-symbols.ts prism/macaulay2.js +prism/node_modules/ +prism/prism.js +prism/prism.js.LICENSE.txt pygments/macaulay2.py rouge/macaulay2.rb atom/macaulay2.cson +textmate/macaulay2.tmLanguage.json From 72d272fd3e0ba99cbf3b0133e263db0feac499c2 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Thu, 31 Oct 2024 21:30:19 -0400 Subject: [PATCH 214/226] Load source for setupLift and setupPromote docs --- M2/Macaulay2/packages/Macaulay2Doc/functions.m2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions.m2 index bb8b38e4d92..0f33fc7054d 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions.m2 @@ -224,6 +224,8 @@ load "./functions/schreyerOrder-doc.m2" load "./functions/select-doc.m2" load "./functions/separate-doc.m2" load "./functions/setRandomSeed-doc.m2" +load "./functions/setupLift-doc.m2" +load "./functions/setupPromote-doc.m2" load "./functions/show-doc.m2" load "./functions/sin-doc.m2" load "./functions/sinh-doc.m2" From aac8cd19aacd5790a5319dbeed4aa38aa3f935e4 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 25 Oct 2024 12:24:12 -0400 Subject: [PATCH 215/226] Document changes for version 1.24.11 --- M2/Macaulay2/packages/Macaulay2Doc/changes.m2 | 53 +++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 index f7084a1d670..6648d14c245 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 @@ -73,20 +73,67 @@ document { LI { star, " ", TO "SubalgebraBases::SubalgebraBases", ", a package by Michael Burr, Oliver Clarke, Timothy Duff, Jackson Leaman, Nathan Nichols, and Elise Walker for Canonical subalgebra bases (aka SAGBI/Khovanskii bases), has been published." } } }, - LI { "functionality changed in a way that could break code:", + LI { "new packages: ", UL { - LI { "The function ", TO remove, ", which previously had no return value, now returns the value that was removed." } + LI { TO "AbstractSimplicialComplexes::AbstractSimplicialComplexes", ", a package by Nathan Grieve for abstract simplicial complexes, has been added." }, + LI { TO "Msolve::Msolve", ", a package by Martin Helmer, Mike Stillman, and Anton Leykin for interfacing with the msolve library for solving multivariate polynomial systems using Groebner Bases, has been added." }, + LI { TO "MultigradedImplicitization::MultigradedImplicitization", ", a package by Joseph Cummings and Benjamin Hollering for solving implicitization problems using multigradings, has been added." }, + LI { TO "NumericalSemigroups::NumericalSemigroups", ", a package by David Eisenbud and Frank-Olaf Schreyer for computing the Apery set and invariants of a numerical semigroup ring, has been added." }, + LI { TO "Permutations::Permutations", ", a package by Sean Grate for functions for working with permutations, has been added." }, + LI { TO "SCMAlgebras::SCMAlgebras", ", a package by Ernesto Lax for sequentially Cohen-Macaulay modules or ideals, has been added." } } }, LI { "improved packages:", UL { + LI { TO "A1BrouwerDegrees::A1BrouwerDegrees", " has been updated to version 1.1 with bug fixes and improved documentation."}, + LI { TO "AssociativeAlgebras::AssociativeAlgebras", " has been updated to version 0.9 with new functions related to derivation-quotient algebras, superpotentials, and Nakayama automorphisms of m-Koszul Artin-Schelter regular algebras."}, + LI { TO "ForeignFunctions::ForeignFunctions", " has been updated to version 0.4 with improved documentation."}, LI { TO "Jets::Jets", " has been updated to version 1.2 with improvements and new methods for principal jets."}, + LI { TO "LieTypes::LieTypes", " has been updated to version 0.82 with bug fixes, improved documentation, and a new method, ", TO "LieTypes::zeroModule", "."}, + LI { TO "PositivityToricBundles::PositivityToricBundles", " has been updated to version 1.9 with bug fixes and a new method, ", TO "PositivityToricBundles::wellformedBundleFiltrations", "."}, + LI { TO "Probability::Probability", " has been updated to version 0.5 with improved documentation." }, + LI { TO "Seminormalization::Seminormalization", " has been updated to version 0.22 with several improvements."}, + LI { TO "TerraciniLoci::TerraciniLoci", " has been updated to version 0.2 with minor updates." }, + LI { TO "Triangulations::Triangulations", " has been updated to version 0.2 with a bug fix." }, + LI { TO "VectorGraphics::VectorGraphics", " has been updated to version 1.1 with several improvements."}, + LI { TO "Visualize::Visualize", " has been updated to version 1.6 with improvements to the JavaScript code."} + } + }, + LI { "functionality added or improved:", + UL { + LI { "It is now possible to construct an empty matrix by passing an empty list to ", TO matrix, "." }, + LI { TO LUdecomposition, " now supports empty real and complex matrices." }, + LI { "The ", TO "version", " hash table now contains a \"git branch\" key." }, + LI { "The version number displayed in the startup banner now includes git information." }, + LI { TO copyright, " is now a command that displays the ", TO "Copyright and license", " documentation."}, + LI { "A number of improvements have been made to methods dealing with ", TO MonomialIdeal, " objects."}, + LI { "The function ", TO remove, ", which previously had no return value, now returns the value that was removed." }, + LI { "The function ", TO changeDirectory, ", for changing the working directory, has been added." }, + LI { "Many numerical functions that previously did not accept ", TO CC, " or ", TO RRi, " arguments now do." }, + LI { "The functions ", TO selectKeys, ", ", TO selectValues, ", and ", TO selectPairs, " for selecting from hash tables have been added." }, + LI { "It is now possible to edit the list of packages that are loaded when Macaulay2 starts up by modifying the list ", M2CODE "Core#\"preloaded packages\"", " in ", CODE "init.m2", "." }, + LI { "The classes ", TO Constant, ", ", TO InfiniteNumber, " and ", TO IndeterminateNumber, " are now all subclasses of ", TO Number, "."}, + LI { "Hash codes are now unsigned 64-bit integers, vastly reducing the probability of running out when creating new types."}, + LI { "It is now possible to compare ", TO GroebnerBasis, " objects using ", TO symbol ==, "." }, + LI { "Items in the \"ways to use\" section of documentation pages are now formatted using ", TO "Text::KBD", "."}, + LI { "It is now possible to use ", TO symbol try, " with ", TO symbol then, ", but without ", TO symbol else, "."}, + LI { "The function ", TO headlines, " has been added for viewing documentation headlines."}, + LI { "When running Macaulay2 without the ", CODE "--no-readline", " option, command history is now saved between sessions. This history can be found in the file ", CODE "history.m2", " in the ", TO applicationDirectory, "."}, + LI { "The error message is now more informative when a key is not found in a hash table." }, + LI { "New methods for scalar division, e.g., ", TO (symbol /, Matrix, Number), " have been added." }, + LI { "The restriction on promotion/lifting has been relaxed so one can promote/lift between any two rings, and apply this to fraction fields and tensor products." } + } + }, + LI { "functionality changed in a way that could break code:", + UL { + LI { "Testing equality of zero modules using ", TO symbol ==, " so that two zero modules are equal if they are equal as cosets. The only implication is that zero submodules of any free module are now the same, but zero submodules of arbitrary modules are only the same if they have the same ambient module." }, + LI { "The syntactic sugar ", CODE "T OP= f", " for ", TO "installing augmented assignment methods", " has been removed." }, + LI { TO symbol TEST, " is now a keyword instead of a method function. It functionality remains essentially unchanged. However, its ", TO FileName, " option has been removed. Use ", M2CODE "TEST get(...)", " instead when storing the code for a test in a file." } } } } } - document { Key => "changes, 1.24.05", UL { From 4ea7f15b75612648d283142b0cae4214b5eb7a72 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Fri, 1 Nov 2024 02:45:02 +0100 Subject: [PATCH 216/226] added two entries to changes.m2 --- M2/Macaulay2/packages/Macaulay2Doc/changes.m2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 index 6648d14c245..d4a2e42cc73 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 @@ -101,6 +101,8 @@ document { }, LI { "functionality added or improved:", UL { + LI { "A new function ", TO headlines, " is now available for viewing a table of documentation + headlines from a list produced by ", TO methods, ", ", TO about, ", or ", TO apropos, "."}, LI { "It is now possible to construct an empty matrix by passing an empty list to ", TO matrix, "." }, LI { TO LUdecomposition, " now supports empty real and complex matrices." }, LI { "The ", TO "version", " hash table now contains a \"git branch\" key." }, @@ -117,7 +119,6 @@ document { LI { "It is now possible to compare ", TO GroebnerBasis, " objects using ", TO symbol ==, "." }, LI { "Items in the \"ways to use\" section of documentation pages are now formatted using ", TO "Text::KBD", "."}, LI { "It is now possible to use ", TO symbol try, " with ", TO symbol then, ", but without ", TO symbol else, "."}, - LI { "The function ", TO headlines, " has been added for viewing documentation headlines."}, LI { "When running Macaulay2 without the ", CODE "--no-readline", " option, command history is now saved between sessions. This history can be found in the file ", CODE "history.m2", " in the ", TO applicationDirectory, "."}, LI { "The error message is now more informative when a key is not found in a hash table." }, LI { "New methods for scalar division, e.g., ", TO (symbol /, Matrix, Number), " have been added." }, @@ -126,6 +127,9 @@ document { }, LI { "functionality changed in a way that could break code:", UL { + LI { "The behavior of ", TO basis, " over tower rings has changed. Previously basis was computed + over the most recent coefficient ring, but now it is computed over the first coefficient ring. + Previous behavior can be mimicked by passing the option ", TT "basis(..., Variables => gens R)", "." }, LI { "Testing equality of zero modules using ", TO symbol ==, " so that two zero modules are equal if they are equal as cosets. The only implication is that zero submodules of any free module are now the same, but zero submodules of arbitrary modules are only the same if they have the same ambient module." }, LI { "The syntactic sugar ", CODE "T OP= f", " for ", TO "installing augmented assignment methods", " has been removed." }, LI { TO symbol TEST, " is now a keyword instead of a method function. It functionality remains essentially unchanged. However, its ", TO FileName, " option has been removed. Use ", M2CODE "TEST get(...)", " instead when storing the code for a test in a file." } From c9ea7fad5acb08238c74fdce9c253deff89e1f64 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 1 Nov 2024 05:57:40 -0400 Subject: [PATCH 217/226] Release Macaulay2 1.24.11 --- M2/Macaulay2/packages/Macaulay2Doc/changes.m2 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 index d4a2e42cc73..079dd9a8219 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/changes.m2 @@ -5,7 +5,8 @@ star := IMG { "src" => replace("PKG","Style",currentLayout#"package") | "GoldSta document { Key => "changes to Macaulay2, by version", Subnodes => { - TO "changes made for the next release", + -- TO "changes made for the next release", + TO "changes, 1.24.11", TO "changes, 1.24.05", TO "changes, 1.23", TO "changes, 1.22", @@ -63,8 +64,11 @@ changesHelper List := opt -> pkgnames -> ( << ".\" }," << endl))) +-- document { +-- Key => "changes made for the next release"} + document { - Key => "changes made for the next release", + Key => "changes, 1.24.11", UL { LI { "packages that have been published and certified:", UL { From 07272c49b5c7ab237228005371e091edaeaf01e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:39:35 +0000 Subject: [PATCH 218/226] Bump webpack Bumps the prism-dependencies group in /M2/Macaulay2/editors/prism with 1 update: [webpack](https://github.com/webpack/webpack). Updates `webpack` from 5.96.0 to 5.96.1 - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.96.0...v5.96.1) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-patch dependency-group: prism-dependencies ... Signed-off-by: dependabot[bot] --- M2/Macaulay2/editors/prism/package-lock.json | 29 +++++++++++++++++--- M2/Macaulay2/editors/prism/package.json | 2 +- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/M2/Macaulay2/editors/prism/package-lock.json b/M2/Macaulay2/editors/prism/package-lock.json index 02fff8ad60f..d0ed0c17d76 100644 --- a/M2/Macaulay2/editors/prism/package-lock.json +++ b/M2/Macaulay2/editors/prism/package-lock.json @@ -10,7 +10,7 @@ "devDependencies": { "css-loader": "^7.1.2", "style-loader": "^4.0.0", - "webpack": "^5.75.0", + "webpack": "^5.96.1", "webpack-cli": "^5.0.1" } }, @@ -81,6 +81,26 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@types/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "dev": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "dev": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -1422,11 +1442,12 @@ } }, "node_modules/webpack": { - "version": "5.96.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.0.tgz", - "integrity": "sha512-gvn84AfQ4f6vUeNWmFuRp3vGERyxK4epADKTaAo60K0EQbY/YBNQbXH3Ji/ZRK5M25O/XneAOuChF4xQZjQ4xA==", + "version": "5.96.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", + "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", "dev": true, "dependencies": { + "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", diff --git a/M2/Macaulay2/editors/prism/package.json b/M2/Macaulay2/editors/prism/package.json index 3a2ee31eb3e..589a15f8d07 100644 --- a/M2/Macaulay2/editors/prism/package.json +++ b/M2/Macaulay2/editors/prism/package.json @@ -8,7 +8,7 @@ "devDependencies": { "css-loader": "^7.1.2", "style-loader": "^4.0.0", - "webpack": "^5.75.0", + "webpack": "^5.96.1", "webpack-cli": "^5.0.1" } } From 46ee815fff684661e8a1c477b2acacd6d394e60f Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 1 Nov 2024 11:12:42 -0400 Subject: [PATCH 219/226] Remove prism's package-lock.json from git It's generated automatically. Also add to .gitignore [ci skip] --- M2/Macaulay2/editors/.gitignore | 1 + M2/Macaulay2/editors/prism/package-lock.json | 1589 ------------------ 2 files changed, 1 insertion(+), 1589 deletions(-) delete mode 100644 M2/Macaulay2/editors/prism/package-lock.json diff --git a/M2/Macaulay2/editors/.gitignore b/M2/Macaulay2/editors/.gitignore index 4a72c90f831..5e66d6b90fe 100644 --- a/M2/Macaulay2/editors/.gitignore +++ b/M2/Macaulay2/editors/.gitignore @@ -5,6 +5,7 @@ highlightjs/macaulay2.js Macaulay2Web/M2-symbols.ts prism/macaulay2.js prism/node_modules/ +prism/package-lock.json prism/prism.js prism/prism.js.LICENSE.txt pygments/macaulay2.py diff --git a/M2/Macaulay2/editors/prism/package-lock.json b/M2/Macaulay2/editors/prism/package-lock.json deleted file mode 100644 index d0ed0c17d76..00000000000 --- a/M2/Macaulay2/editors/prism/package-lock.json +++ /dev/null @@ -1,1589 +0,0 @@ -{ - "name": "prism", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "prismjs": "^1.29.0" - }, - "devDependencies": { - "css-loader": "^7.1.2", - "style-loader": "^4.0.0", - "webpack": "^5.96.1", - "webpack-cli": "^5.0.1" - } - }, - "node_modules/@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@types/eslint": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", - "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dev": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, - "node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, - "node_modules/@types/node": { - "version": "22.8.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.6.tgz", - "integrity": "sha512-tosuJYKrIqjQIlVCM4PEGxOmyg3FCPa/fViuJChnGeEIhjA46oy8FMVoF9su1/v8PNs2a8Q0iFNyOx0uOF91nw==", - "dev": true, - "dependencies": { - "undici-types": "~6.19.8" - } - }, - "node_modules/@webassemblyjs/ast": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", - "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", - "dev": true, - "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6" - } - }, - "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", - "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", - "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", - "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", - "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", - "dev": true, - "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.6", - "@webassemblyjs/helper-api-error": "1.11.6", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", - "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", - "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.12.1" - } - }, - "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", - "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", - "dev": true, - "dependencies": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "node_modules/@webassemblyjs/leb128": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", - "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", - "dev": true, - "dependencies": { - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webassemblyjs/utf8": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", - "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", - "dev": true - }, - "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", - "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.12.1", - "@webassemblyjs/wasm-gen": "1.12.1", - "@webassemblyjs/wasm-opt": "1.12.1", - "@webassemblyjs/wasm-parser": "1.12.1", - "@webassemblyjs/wast-printer": "1.12.1" - } - }, - "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", - "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" - } - }, - "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", - "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/wasm-gen": "1.12.1", - "@webassemblyjs/wasm-parser": "1.12.1" - } - }, - "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", - "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-api-error": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" - } - }, - "node_modules/@webassemblyjs/wast-printer": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", - "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@webpack-cli/configtest": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz", - "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==", - "dev": true, - "engines": { - "node": ">=14.15.0" - }, - "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" - } - }, - "node_modules/@webpack-cli/info": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz", - "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==", - "dev": true, - "engines": { - "node": ">=14.15.0" - }, - "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" - } - }, - "node_modules/@webpack-cli/serve": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz", - "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==", - "dev": true, - "engines": { - "node": ">=14.15.0" - }, - "peerDependencies": { - "webpack": "5.x.x", - "webpack-cli": "5.x.x" - }, - "peerDependenciesMeta": { - "webpack-dev-server": { - "optional": true - } - } - }, - "node_modules/@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "node_modules/@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "node_modules/acorn": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", - "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/browserslist": { - "version": "4.24.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", - "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "caniuse-lite": "^1.0.30001669", - "electron-to-chromium": "^1.5.41", - "node-releases": "^2.0.18", - "update-browserslist-db": "^1.1.1" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001676", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001676.tgz", - "integrity": "sha512-Qz6zwGCiPghQXGJvgQAem79esjitvJ+CxSbSQkW9H/UX5hg8XM88d4lp2W+MEQ81j+Hip58Il+jGVdazk1z9cw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ] - }, - "node_modules/chrome-trace-event": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", - "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", - "dev": true, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/css-loader": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-7.1.2.tgz", - "integrity": "sha512-6WvYYn7l/XEGN8Xu2vWFt9nVzrCn39vKyTEFf/ExEyoksJjjSZV/0/35XPlMbpnr6VGhZIUg5yJrL8tGfes/FA==", - "dev": true, - "dependencies": { - "icss-utils": "^5.1.0", - "postcss": "^8.4.33", - "postcss-modules-extract-imports": "^3.1.0", - "postcss-modules-local-by-default": "^4.0.5", - "postcss-modules-scope": "^3.2.0", - "postcss-modules-values": "^4.0.0", - "postcss-value-parser": "^4.2.0", - "semver": "^7.5.4" - }, - "engines": { - "node": ">= 18.12.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "@rspack/core": "0.x || 1.x", - "webpack": "^5.27.0" - }, - "peerDependenciesMeta": { - "@rspack/core": { - "optional": true - }, - "webpack": { - "optional": true - } - } - }, - "node_modules/cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "dev": true, - "bin": { - "cssesc": "bin/cssesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/electron-to-chromium": { - "version": "1.5.50", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.50.tgz", - "integrity": "sha512-eMVObiUQ2LdgeO1F/ySTXsvqvxb6ZH2zPGaMYsWzRDdOddUa77tdmI0ltg+L16UpbWdhPmuF3wIQYyQq65WfZw==", - "dev": true - }, - "node_modules/enhanced-resolve": { - "version": "5.17.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", - "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/envinfo": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.14.0.tgz", - "integrity": "sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg==", - "dev": true, - "bin": { - "envinfo": "dist/cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/es-module-lexer": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", - "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", - "dev": true - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fastest-levenshtein": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", - "dev": true, - "engines": { - "node": ">= 4.9.1" - } - }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "bin": { - "flat": "cli.js" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/icss-utils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", - "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/import-local": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", - "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", - "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/interpret": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", - "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", - "dev": true, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/is-core-module": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", - "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", - "dev": true, - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", - "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", - "dev": true, - "engines": { - "node": ">=6.11.5" - } - }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "node_modules/node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", - "dev": true - }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/postcss": { - "version": "8.4.47", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", - "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.1.0", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-modules-extract-imports": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", - "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-local-by-default": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.5.tgz", - "integrity": "sha512-6MieY7sIfTK0hYfafw1OMEG+2bg8Q1ocHCpoWLqOKj3JXlKu4G7btkmM/B7lFubYkYWmRSPLZi5chid63ZaZYw==", - "dev": true, - "dependencies": { - "icss-utils": "^5.0.0", - "postcss-selector-parser": "^6.0.2", - "postcss-value-parser": "^4.1.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-scope": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.0.tgz", - "integrity": "sha512-oq+g1ssrsZOsx9M96c5w8laRmvEu9C3adDSjI8oTcbfkrTE8hx/zfyobUoWIxaKPO8bt6S62kxpw5GqypEw1QQ==", - "dev": true, - "dependencies": { - "postcss-selector-parser": "^6.0.4" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-values": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", - "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", - "dev": true, - "dependencies": { - "icss-utils": "^5.0.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-selector-parser": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", - "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", - "dev": true, - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "dev": true - }, - "node_modules/prismjs": { - "version": "1.29.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", - "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", - "engines": { - "node": ">=6" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/rechoir": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", - "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", - "dev": true, - "dependencies": { - "resolve": "^1.20.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/style-loader": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-4.0.0.tgz", - "integrity": "sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==", - "dev": true, - "engines": { - "node": ">= 18.12.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.27.0" - } - }, - "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/terser": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", - "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", - "dev": true, - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/terser-webpack-plugin": { - "version": "5.3.10", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", - "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.20", - "jest-worker": "^27.4.5", - "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.1", - "terser": "^5.26.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.1.0" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "uglify-js": { - "optional": true - } - } - }, - "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "dev": true - }, - "node_modules/update-browserslist-db": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", - "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.0" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, - "node_modules/watchpack": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", - "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", - "dev": true, - "dependencies": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/webpack": { - "version": "5.96.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", - "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", - "dev": true, - "dependencies": { - "@types/eslint-scope": "^3.7.7", - "@types/estree": "^1.0.6", - "@webassemblyjs/ast": "^1.12.1", - "@webassemblyjs/wasm-edit": "^1.12.1", - "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.14.0", - "browserslist": "^4.24.0", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.1", - "es-module-lexer": "^1.2.1", - "eslint-scope": "5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.11", - "json-parse-even-better-errors": "^2.3.1", - "loader-runner": "^4.2.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "schema-utils": "^3.2.0", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.10", - "watchpack": "^2.4.1", - "webpack-sources": "^3.2.3" - }, - "bin": { - "webpack": "bin/webpack.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependenciesMeta": { - "webpack-cli": { - "optional": true - } - } - }, - "node_modules/webpack-cli": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", - "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", - "dev": true, - "dependencies": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^2.1.1", - "@webpack-cli/info": "^2.0.2", - "@webpack-cli/serve": "^2.0.5", - "colorette": "^2.0.14", - "commander": "^10.0.1", - "cross-spawn": "^7.0.3", - "envinfo": "^7.7.3", - "fastest-levenshtein": "^1.0.12", - "import-local": "^3.0.2", - "interpret": "^3.1.1", - "rechoir": "^0.8.0", - "webpack-merge": "^5.7.3" - }, - "bin": { - "webpack-cli": "bin/cli.js" - }, - "engines": { - "node": ">=14.15.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "5.x.x" - }, - "peerDependenciesMeta": { - "@webpack-cli/generators": { - "optional": true - }, - "webpack-bundle-analyzer": { - "optional": true - }, - "webpack-dev-server": { - "optional": true - } - } - }, - "node_modules/webpack-cli/node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/webpack-merge": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", - "integrity": "sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==", - "dev": true, - "dependencies": { - "clone-deep": "^4.0.1", - "flat": "^5.0.2", - "wildcard": "^2.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/webpack-sources": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "dev": true, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wildcard": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", - "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", - "dev": true - } - } -} From 334f311d4d5b97624955802c410ac7512e440a6a Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 1 Nov 2024 15:28:04 -0400 Subject: [PATCH 220/226] Update fedora docker image registry.fedoraproject.org was replaced with quay.io. We also default to "latest" for ease of maintenance rather than specifying a version, but allow the user to override this using the RELEASE variable. --- M2/BUILD/docker/fedora/Dockerfile | 4 +++- M2/BUILD/docker/fedora/Makefile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/M2/BUILD/docker/fedora/Dockerfile b/M2/BUILD/docker/fedora/Dockerfile index 132b2f786e7..ae7c8b99a7b 100644 --- a/M2/BUILD/docker/fedora/Dockerfile +++ b/M2/BUILD/docker/fedora/Dockerfile @@ -2,7 +2,9 @@ # Net usage: 54+124+ # Disk usage: ?? -FROM registry.fedoraproject.org/fedora-minimal:32 +ARG RELEASE=latest + +FROM quay.io/fedora/fedora-minimal:$RELEASE # Programs we require to build # kernel-devel rpm-build rpm-sign rpmdevtools diff --git a/M2/BUILD/docker/fedora/Makefile b/M2/BUILD/docker/fedora/Makefile index eb654648f87..7ebbe943901 100644 --- a/M2/BUILD/docker/fedora/Makefile +++ b/M2/BUILD/docker/fedora/Makefile @@ -1,7 +1,9 @@ include ../ubuntu/Makefile ## Parameters -TAG = m2-fedora-build +RELEASE = latest +BUILD_ARGS = --build-arg RELEASE=$(RELEASE) +TAG = m2-fedora-$(RELEASE)-build BUILD_DIR = M2/BUILD/build-docker BUILD_OPT = -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr From 2cf661f84a7e81201e8bce303a8fa68f7fe797a3 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 1 Nov 2024 15:29:55 -0400 Subject: [PATCH 221/226] Fix calls to microdnf in fedora dockerfile Needs -y option, and a couple packages had incorrect names --- M2/BUILD/docker/fedora/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/M2/BUILD/docker/fedora/Dockerfile b/M2/BUILD/docker/fedora/Dockerfile index ae7c8b99a7b..44718ec95ed 100644 --- a/M2/BUILD/docker/fedora/Dockerfile +++ b/M2/BUILD/docker/fedora/Dockerfile @@ -8,23 +8,23 @@ FROM quay.io/fedora/fedora-minimal:$RELEASE # Programs we require to build # kernel-devel rpm-build rpm-sign rpmdevtools -RUN microdnf install autoconf bison ccache cmake curl diffutils file gcc-c++ git \ +RUN microdnf install -y autoconf bison ccache cmake curl diffutils file gcc-c++ git \ gnupg libtool make ninja-build patch yasm rpm-build rpmlint which # Libraries we require -RUN microdnf install openblas-devel libxml2-devel readline-devel gdbm-devel \ - boost-devel libomp-dev libtbb-dev +RUN microdnf install -y openblas-devel libxml2-devel readline-devel gdbm-devel \ + boost-devel libomp-devel tbb-devel # Libraries we can build (factory not available on ubuntu) -RUN microdnf install eigen3-devel glpk-devel gmp-devel mpfr-devel ntl-devel \ +RUN microdnf install -y eigen3-devel glpk-devel gmp-devel mpfr-devel ntl-devel \ libnauty-devel libnormaliz-devel libfrobby-devel gc-devel # Programs we can build # TODO: cohomcalg available soon. Polymake requires firefox??? -#RUN microdnf install libcdd-devel 4ti2 gfan normaliz coinor-csdp nauty lrslib +RUN microdnf install -y cddlib-devel 4ti2 gfan normaliz csdp-tools nauty lrslib # Optional packages -RUN microdnf install mlocate bash-completion +RUN microdnf install -y mlocate bash-completion # Add non-root user for building and running Macaulay2 RUN useradd -G wheel -g root -u 1000 -m macaulay && echo "macaulay ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers From ab0d467393ed8cde0a81254d61a5f1d53ca39b43 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 1 Nov 2024 16:05:54 -0400 Subject: [PATCH 222/226] Update required fedora packages for docker build --- M2/BUILD/docker/fedora/Dockerfile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/M2/BUILD/docker/fedora/Dockerfile b/M2/BUILD/docker/fedora/Dockerfile index 44718ec95ed..f5db5939ca3 100644 --- a/M2/BUILD/docker/fedora/Dockerfile +++ b/M2/BUILD/docker/fedora/Dockerfile @@ -8,23 +8,27 @@ FROM quay.io/fedora/fedora-minimal:$RELEASE # Programs we require to build # kernel-devel rpm-build rpm-sign rpmdevtools -RUN microdnf install -y autoconf bison ccache cmake curl diffutils file gcc-c++ git \ - gnupg libtool make ninja-build patch yasm rpm-build rpmlint which +RUN microdnf install -y autoconf bison ccache cmake curl diffutils file \ + gcc-c++ git gnupg libtool make ninja-build patch yasm rpm-build rpmlint \ + which flex gcc-gfortran # Libraries we require RUN microdnf install -y openblas-devel libxml2-devel readline-devel gdbm-devel \ - boost-devel libomp-devel tbb-devel + boost-devel libomp-devel tbb-devel python3-devel libffi-devel # Libraries we can build (factory not available on ubuntu) RUN microdnf install -y eigen3-devel glpk-devel gmp-devel mpfr-devel ntl-devel \ - libnauty-devel libnormaliz-devel libfrobby-devel gc-devel + libnauty-devel libnormaliz-devel libfrobby-devel gc-devel mpfi-devel \ + factory-devel mpsolve-devel fflas-ffpack-devel memtailor-devel \ + mathic-devel mathicgb-devel # Programs we can build -# TODO: cohomcalg available soon. Polymake requires firefox??? -RUN microdnf install -y cddlib-devel 4ti2 gfan normaliz csdp-tools nauty lrslib +# TODO: Polymake requires firefox??? +RUN microdnf install -y cddlib-devel 4ti2 gfan normaliz csdp-tools nauty \ + lrslib-utils cohomCalg msolve # Optional packages -RUN microdnf install -y mlocate bash-completion +RUN microdnf install -y mlocate bash-completion R # Add non-root user for building and running Macaulay2 RUN useradd -G wheel -g root -u 1000 -m macaulay && echo "macaulay ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers From 7c72dac3becf3589bb65f7e2619a426ed06b58b4 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sat, 2 Nov 2024 21:35:00 -0400 Subject: [PATCH 223/226] Replace mlocate w/ plocate in fedora dockerfile (mlocate obsolete) --- M2/BUILD/docker/fedora/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/BUILD/docker/fedora/Dockerfile b/M2/BUILD/docker/fedora/Dockerfile index f5db5939ca3..4a3d5a09d23 100644 --- a/M2/BUILD/docker/fedora/Dockerfile +++ b/M2/BUILD/docker/fedora/Dockerfile @@ -28,7 +28,7 @@ RUN microdnf install -y cddlib-devel 4ti2 gfan normaliz csdp-tools nauty \ lrslib-utils cohomCalg msolve # Optional packages -RUN microdnf install -y mlocate bash-completion R +RUN microdnf install -y plocate bash-completion R # Add non-root user for building and running Macaulay2 RUN useradd -G wheel -g root -u 1000 -m macaulay && echo "macaulay ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers From 34dc599e356bd410ceaa0ba9c65af40b8deacf34 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sat, 2 Nov 2024 22:07:40 -0400 Subject: [PATCH 224/226] Add build-autotools target to fedora docker makefile For building Fedora packages --- M2/BUILD/docker/fedora/Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/M2/BUILD/docker/fedora/Makefile b/M2/BUILD/docker/fedora/Makefile index 7ebbe943901..36fdab4bfcd 100644 --- a/M2/BUILD/docker/fedora/Makefile +++ b/M2/BUILD/docker/fedora/Makefile @@ -10,3 +10,24 @@ BUILD_OPT = -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr rpm:; docker run $(VOLUME) -it --entrypoint "" $(TAG) bash -c "cd M2/$(BUILD_DIR); cpack -G RPM" rpmlint:; docker run $(VOLUME) -it --entrypoint "" $(TAG) bash -c "rpmlint M2/$(BUILD_DIR)/Macaulay2-*.rpm" + +## autotools build +## TODO: generalize this to other distros, move to toplevel Makefile + +CONFIG_OPT = --with-system-gc --with-system-memtailor --with-system-mathic \ + --with-system-mathicgb --enable-download --enable-rpm --prefix=/usr + +define M2_BUILD_SCRIPT_autotools +set -xe + +mkdir -p M2/$(BUILD_DIR) +cd M2/$(BUILD_DIR) +$(M2_HOME)/M2/M2/autogen.sh +$(M2_HOME)/M2/M2/configure $(CONFIG_OPT) +make +endef +export M2_BUILD_SCRIPT_autotools + +build-autotools: build-image + docker run $(VOLUME) -it --entrypoint="" $(TAG) \ + bash -c "$$M2_BUILD_SCRIPT_autotools" From 26c1f752b04fda35f71ef86665ad7aab4b0699b7 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sat, 2 Nov 2024 22:11:35 -0400 Subject: [PATCH 225/226] Allow lowercase "fedora" when detecting issue (autotools) [ci skip] --- M2/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/configure.ac b/M2/configure.ac index 273c60df1f7..bd5fe56e472 100644 --- a/M2/configure.ac +++ b/M2/configure.ac @@ -120,7 +120,7 @@ then if test -f /usr/bin/sw_vers "debian"|"Debian"*) ISSUE_FLAVOR=Debian ;; "ubuntu"|"Ubuntu") ISSUE_FLAVOR=Ubuntu ;; "FedoraCore"*) ISSUE_FLAVOR=FedoraCore ;; - "Fedora"*) ISSUE_FLAVOR=Fedora ;; + "fedora"|"Fedora"*) ISSUE_FLAVOR=Fedora ;; "RedHatEnterprise"*) ISSUE_FLAVOR=RedHatEnterprise ;; "RedHat"*) ISSUE_FLAVOR=RedHat ;; "Scientific"*) ISSUE_FLAVOR="ScientificLinux" ;; From 6a1ee7c608f4a424a5f362010023d40b3ddaf34e Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 3 Nov 2024 22:05:50 -0500 Subject: [PATCH 226/226] Run autogen.sh for re-generating configure script from Makefile [ci skip] --- M2/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Makefile.in b/M2/Makefile.in index 6b619633b13..0fe8a8d2e2b 100644 --- a/M2/Makefile.in +++ b/M2/Makefile.in @@ -67,7 +67,7 @@ clean: if [ -f Makefile ] ; then $(MAKE) -f Makefile clean-tools ; fi install: configured; $(MAKE) -C distributions $@ -@srcdir@/configure : @srcdir@/configure.ac @srcdir@/m4/files; $(MAKE) -C @srcdir@ -f Makefile +@srcdir@/configure : @srcdir@/configure.ac @srcdir@/m4/files; @srcdir@/autogen.sh recheck config.status: @srcdir@/configure @srcdir@/Macaulay2/packages/=distributed-packages $(WHY) ./config.status --recheck