Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add support for the quotient ring ZZ/n when n is large or composite #3218

Merged
merged 4 commits into from
May 10, 2024

Conversation

d-torrance
Copy link
Member

We currently use FLINT for quotient rings created by ZZ/n and thus require n to be prime and to fit inside an unsigned int:

i1 : ZZ/24
stdio:1:3:(3): error: ZZ/n not implemented yet for composite n = 24

i2 : ZZ/nextPrime 2^100
stdio:2:3:(3): error: expected argument 1 to be a small integer

But the engine handles these things just fine if we create a quotient ring of a polynomial ring with no variables, as suggested in #272:

i1 : ZZ/24

     ZZ[]
o1 = ----
      24

o1 : QuotientRing

i2 : ZZ/nextPrime 2^100

                   ZZ[]
o2 = -------------------------------
     1267650600228229401496703205653

o2 : QuotientRing

Closes: #272

Rather than raising an error because FLINT can't handle these, just
fall back on using the engine with a polynomial ring with no
variables.

Closes: Macaulay2#272
* Don't use | since the "typ" variable may not be a string
* Add a newline for readability
* Add an extra assert to ZZpFlint to check that the argument is prime
  and 64-bit.
* Use a prime number with Strategy => null so we actually reach the
  strategy check.
* Replace the "ARing" strategy call with a direct call to the engine.
* Add a check for Strategy => "Old", which was previously missing.
@DanGrayson DanGrayson merged commit c9c7906 into Macaulay2:development May 10, 2024
6 checks passed
@d-torrance d-torrance mentioned this pull request May 11, 2024
@d-torrance d-torrance deleted the quotient-ring-composite branch June 6, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants