Skip to content

Memoize ZZ/n for non-prime n too - #4491

Open
d-torrance wants to merge 1 commit into
Macaulay2:developmentfrom
d-torrance:memoize-zzn
Open

Memoize ZZ/n for non-prime n too#4491
d-torrance wants to merge 1 commit into
Macaulay2:developmentfrom
d-torrance:memoize-zzn

Conversation

@d-torrance

Copy link
Copy Markdown
Member

We currently memoize ZZ/n in the savedQuotients hash table when n is prime, but we don't when it isn't (or is large), causing #4486.

Before

i1 : unique apply(20,i->promote(i,ZZ/4))

o1 = {0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2, -1, 0, 1, 2, -1}

o1 : List

Every element of this list belongs to a distinct ring!

After

i1 : unique apply(20,i->promote(i,ZZ/4))

o1 = {0, 1, 2, -1}

o1 : List

AI Disclosure

No AI used

@d-torrance
d-torrance requested review from ggsmith and seangrate August 3, 2026 13:57
@d-torrance d-torrance linked an issue Aug 3, 2026 that may be closed by this pull request
@d-torrance d-torrance added the Core Issues involving the Core scripts. label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core Issues involving the Core scripts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

non uniqueness of ZZ/n for n nonprime

1 participant