Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e2e4fba
Added the Subring package
fragandi Apr 17, 2025
f1f3aa0
typos handled. Still need to resolve the issue with directory structure
fragandi Apr 18, 2025
2564a4a
Merge branch 'development' into master
fragandi Apr 18, 2025
2b35a8a
directory structure is fixed
fragandi Apr 18, 2025
c5e7721
paths fixed
fragandi Apr 18, 2025
ce9c38d
renamed package Subring -> Subrings
mahrud May 25, 2025
c81444a
deleted .vscode/settings.json
mahrud May 25, 2025
c6774f2
added link to SubalgebraBases in Subrings
mahrud May 25, 2025
308d007
fixed auxiliary file paths in Subrings
mahrud May 25, 2025
98da806
set AuxiliaryFiles for Subrings
mahrud Jun 2, 2025
b38618a
Merge branch 'Macaulay2:stable' into master
fragandi Jun 12, 2026
6d807f5
Add workflow to build and push testbot Docker image
d-torrance Jun 14, 2026
1a37f6f
Trust the Macaulay2 Homebrew tap
d-torrance Jun 6, 2026
fdf5ff2
Merge branch 'Macaulay2:stable' into master
ollieclarke8787 Jul 3, 2026
287c51b
cache subring in matrix
ollieclarke8787 Jul 3, 2026
79bc995
update Subring to handle towers of rings
ollieclarke8787 Jul 3, 2026
c9bb90c
fix M -> genMatrix
ollieclarke8787 Jul 3, 2026
9785924
fix subring opts
ollieclarke8787 Jul 3, 2026
0dd0ba9
add options for subring(List)
ollieclarke8787 Jul 3, 2026
7332fd8
fix isSubringElement to work with towers of rings
ollieclarke8787 Jul 3, 2026
6624403
fix indentation
ollieclarke8787 Jul 3, 2026
149d940
clean up comment
ollieclarke8787 Jul 3, 2026
89210ef
add test for tower of rings
ollieclarke8787 Jul 3, 2026
69c567b
TODO: rewrite isSubringElement to use hooks for future-proofing
ollieclarke8787 Jul 3, 2026
2f4dcb4
export Subring type
ollieclarke8787 Jul 4, 2026
b4777fe
add flattenRing Subring
ollieclarke8787 Jul 5, 2026
7b061ac
clean Subring doc
ollieclarke8787 Jul 5, 2026
ce6a670
clean spacing
ollieclarke8787 Jul 5, 2026
27ee670
use hooks for subring membership
ollieclarke8787 Jul 5, 2026
67170be
fix doc for flattenedRing
ollieclarke8787 Jul 5, 2026
2c5af3e
add flattenedRing doc
ollieclarke8787 Jul 5, 2026
1492759
add tests
ollieclarke8787 Jul 5, 2026
571b39c
use Subring in SubalgebraBases
ollieclarke8787 Jul 7, 2026
7b8351d
Update M2/Macaulay2/packages/Subrings.m2
ollieclarke8787 Aug 12, 2026
6b67548
Update package headline
ollieclarke8787 Aug 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/docker-testbot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow builds the Macaulay2 testbot Docker image from
# M2/BUILD/docker/testbot/Dockerfile and pushes it to GitHub Packages,
# tagged with the current Macaulay2 version (see M2/VERSION) and "latest".
#
# The resulting image is published at
# https://github.com/Macaulay2/M2/pkgs/container/testbot

name: Build and push testbot Docker image

on: workflow_dispatch

env:
IMAGE_NAME: ghcr.io/macaulay2/testbot

jobs:
docker-testbot:
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- uses: actions/checkout@v6

- name: Determine image tags
run: |
M2_VERSION=$(cat M2/VERSION)
echo "M2_VERSION=$M2_VERSION" >> "$GITHUB_ENV"

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push image
uses: docker/build-push-action@v6
with:
context: M2/BUILD/docker/testbot
push: true
tags: |
${{ env.IMAGE_NAME }}:v${{ env.M2_VERSION }}
${{ env.IMAGE_NAME }}:latest
1 change: 1 addition & 0 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
run: |
brew config
brew update
brew trust macaulay2/tap
brew tap macaulay2/tap
brew install automake bison boost libtool tbb ccache ctags llvm make yasm libffi msolve googletest fplll eigen jansson r palp
brew install texinfo || true # sometimes post-install step fails
Expand Down
1 change: 1 addition & 0 deletions M2/Macaulay2/packages/=distributed-packages
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ SpecialFanoFourfolds
RationalPoints2
SuperLinearAlgebra
SubalgebraBases
Subrings
AInfinity
LinearTruncations
ThinSincereQuivers
Expand Down
1 change: 1 addition & 0 deletions M2/Macaulay2/packages/SubalgebraBases.m2
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ 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
PackageExports => {"Subrings"},
Keywords => {"Commutative Algebra"},
Certification => {
"journal name" => "Journal of Software for Algebra and Geometry",
Expand Down
8 changes: 8 additions & 0 deletions M2/Macaulay2/packages/SubalgebraBases/classes.m2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
-- It also contains in its cache a SAGBIBasis
-- object which is the 'furthest-advanced'
-- computation data

-*
-------------------------------
-- Moved to Subrings package --
-------------------------------

Subring = new Type of HashTable

-- Subring constructor
Expand Down Expand Up @@ -57,6 +63,8 @@ net Subring := S -> (
toString(A) | ", subring of " | toString(R)
)

*-

-- SAGBIBasis computation object data-type that inherits from a HashTable
-- A SAGBIBasis represents a partial or complete SAGBI computation.
-- It contains all the data necessary to continue a computation
Expand Down
47 changes: 27 additions & 20 deletions M2/Macaulay2/packages/SubalgebraBases/documentation.m2
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ doc ///
on a collection of ring elements
against each other, one at a time.
This is typically performed on a set of generators of a
@TO "Subring"@ or @TO "SAGBIBasis"@.
@TO "Subrings:Subring"@ or @TO "SAGBIBasis"@.
The result of each subduction replaces the
original element in the collection and zeros are removed from the collection.
If the elements form a subalgebra basis, then the result of
Expand Down Expand Up @@ -1416,7 +1416,7 @@ doc ///
for the intersection but the algorithm cannot
guarantee it.

This function can also be run on a sequence containing both @TO "Subring"@ and
This function can also be run on a sequence containing both @TO "Subrings:Subring"@ and
@TO "IntersectedSubring"@ types. When @TO "CheckFullIntersection"@ is true, all
intermediate intersections are checked for completeness.
Example
Expand All @@ -1441,7 +1441,7 @@ doc ///
The type of all subrings arising from intersection
Description
Text
@TT "IntersectedSubring"@ is a type of @TO "Subring"@ produced
@TT "IntersectedSubring"@ is a type of @TO "Subrings:Subring"@ produced
by intersecting two subrings using the function @TO "intersect"@.
The function @TO "intersect"@ is the constructor for @TT "IntersectedSubring"@.
Applying the function @TO "isFullIntersection"@ to an instance
Expand Down Expand Up @@ -1568,25 +1568,26 @@ doc ///
-- ## classes.m2 documentation ##
-- ##############################
-- Subring
-*
doc ///
Key
Subring
Headline
The type of all subrings
Description
Text
@TT "Subring"@ is a type that stores information associated
@TT "Subrings:Subring"@ is a type that stores information associated
to a subring of a polynomial ring or quotient ring,
such as a set of subring generators and
a reference to the ring containing these generators.
An instance of a @TT "Subring"@ is constructed with the function @TO "subring"@.
For many uses, it is suggested to use a @ TT "Subring"@,
An instance of a @TT "Subrings:Subring"@ is constructed with the function @TO "subring"@.
For many uses, it is suggested to use a @ TT "Subrings:Subring"@,
as the computation objects (@TO "SAGBIBasis"@)
are handled behind the scenes, and
the user experience
is more streamlined.

Every instance of @TT "Subring"@ has the following keys
Every instance of @TT "Subrings:Subring"@ has the following keys
(some of which are strings):

@UL {
Expand Down Expand Up @@ -1629,9 +1630,9 @@ doc ///
A = subring S
Inputs
M:Matrix
whose entries are the generators for the constructed @TO "Subring"@.
whose entries are the generators for the constructed @TO "Subrings:Subring"@.
L:List
containing generators for the constructed @TO "Subring"@.
containing generators for the constructed @TO "Subrings:Subring"@.
S:SAGBIBasis
GeneratorSymbol=>Symbol
a symbol to be used for the variables of the @ TT "presentationRing" @.
Expand All @@ -1640,7 +1641,7 @@ doc ///
generated by the input generators.
Description
Text
This function serves as the canonical constructor for the @TO "Subring"@ type.
This function serves as the canonical constructor for the @TO "Subrings:Subring"@ type.
For many uses, it is suggested to use @ ofClass Subring@,
as the computation objects (@TO "SAGBIBasis"@)
are handled behind the scenes, and
Expand Down Expand Up @@ -1677,7 +1678,7 @@ doc ///
result:Matrix
Description
Text
Returns a generating set for the @TO "Subring"@ as a one-row matrix.
Returns a generating set for the @TO "Subrings:Subring"@ as a one-row matrix.
Example
R = QQ[x,y,z];
S = subring({x^2, y^2, z^2});
Expand All @@ -1701,7 +1702,7 @@ doc ///
result:Ring
Description
Text
Returns the ambient ring of the generating set of the @TO "Subring"@.
Returns the ambient ring of the generating set of the @TO "Subrings:Subring"@.
This may be a @TO "PolynomialRing"@ or @TO "QuotientRing"@.
Example
R = QQ[x,y,z];
Expand Down Expand Up @@ -1731,7 +1732,7 @@ doc ///
the number of generators of S
Description
Text
Returns the number of generators of a @TO "Subring"@.
Returns the number of generators of a @TO "Subrings:Subring"@.
Example
R = QQ[x,y,z];
S = subring({x^2, y^2, z^2, x^2+y^2});
Expand All @@ -1745,6 +1746,7 @@ doc ///
(net, Subring)
(flattenedRing, Subring)
///
*-
-- (numgens, SAGBIBasis)
doc ///
Key
Expand Down Expand Up @@ -1777,6 +1779,7 @@ doc ///
(net, Subring)
(flattenedRing, SAGBIBasis)
///
-*
-- (net, Subring)
doc ///
Key
Expand All @@ -1792,7 +1795,7 @@ doc ///
obtained by formatting S for printing.
Description
Text
Displays the presentation and ambient rings of a @TO "Subring"@.
Displays the presentation and ambient rings of a @TO "Subrings:Subring"@.
Example
R = QQ[x,y];
S = subring{x^2,x*y^2,y^4}
Expand Down Expand Up @@ -1827,6 +1830,7 @@ doc ///
subring
presentationRing
///
*-
-- SAGBIBasis
doc ///
Key
Expand Down Expand Up @@ -1909,7 +1913,7 @@ doc ///
Text
This function serves as the canonical constructor for the @TO "SAGBIBasis"@ type.
The @TT "SAGBIBasis"@ type is also the output of the function @TO "sagbi"@.
The @ TO "Subring"@ used to construct a @TT "SAGBIBasis"@ may be recovered using
The @ TO "Subrings:Subring"@ used to construct a @TT "SAGBIBasis"@ may be recovered using
@TO "subring"@
Example
R = QQ[x,y];
Expand Down Expand Up @@ -1951,7 +1955,7 @@ doc ///
Description
Text
Returns a list of subalgebra generators of the
@TO "Subring"@ underlying the @TO "SAGBIBasis"@.
@TO "Subrings:Subring"@ underlying the @TO "SAGBIBasis"@.
If the subalgebra generators do not form a complete subalgebra basis
(for example if they were obtained from a partial computation),
then the generators obtained from this command
Expand Down Expand Up @@ -2015,7 +2019,7 @@ doc ///
Description
Text
Returns the ambient ring of @ ofClass SAGBIBasis @.
This is the ambient ring of the generating @TO "Subring"@
This is the ambient ring of the generating @TO "Subrings:Subring"@
This may be a @TO "PolynomialRing"@ or @TO "QuotientRing"@.
Example
R = QQ[x,y,z];
Expand All @@ -2030,7 +2034,6 @@ doc ///
SAGBIBasis
sagbiBasis
(gens, SAGBIBasis)
(ambient, Subring)
///
-- (ring, SAGBIBasis)
doc ///
Expand Down Expand Up @@ -2420,6 +2423,7 @@ doc ///
UseSubringGens
SubductionMethod
///
-*
-- presentationRing
doc ///
Key
Expand Down Expand Up @@ -2471,6 +2475,7 @@ doc ///
(ambient, Subring)
(flattenedRing, Subring)
///
*-
-- #########################################
-- ## Short Explanation of Screws Example ##
-- #########################################
Expand Down Expand Up @@ -2634,6 +2639,7 @@ doc ///
subalgebraBasis
subduction
///
-*
-- flatenedRing
doc ///
Key
Expand All @@ -2643,8 +2649,8 @@ doc ///
Headline
The flattened ring of a subring or sagbiBasis
Usage
result = flattened S
result = flattened SB
result = flattenedRing S
result = flattenedRing SB
Inputs
S:Subring
SB:SAGBIBasis
Expand All @@ -2667,4 +2673,5 @@ doc ///
sagbiBasis
(ambient, SAGBIBasis)
///
*-
end --
10 changes: 5 additions & 5 deletions M2/Macaulay2/packages/SubalgebraBases/exports.m2
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ export {

-- From classes.m2
export {
"Subring",
-- "Subring",
"SAGBIBasis",
"subring",
-- "subring",
"Compute",
"sagbiBasis",
"GeneratorSymbol",
"presentationRing",
-- "GeneratorSymbol",
-- "presentationRing",
"sagbiStatus",
"sagbiLimit",
"sagbiDegree",
"flattenedRing"
-- "flattenedRing"
}

-- From sagbi-functions.m2
Expand Down
1 change: 1 addition & 0 deletions M2/Macaulay2/packages/SubalgebraBases/sagbi-functions.m2
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ subringIntersection(Subring, Subring) := IntersectedSubring => opts -> (S1, S2)
"ambientRing" => A,
"flattenedRing" => Q,
"generators" => intersectionGens,
"originalGenerators" => S1#"inverseFlatteningMap" intersectionGens,
"presentationRing" => subductionRing,
"presentationMap" => presentationMap,
cache => new CacheTable from {},
Expand Down
Loading
Loading